From c3ac93bb9ff8b1fe1fc32f99c725e6cc209aa6ca Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2017 14:22:04 +0300 Subject: Make header line in some modes be sensitive to display-line-numbers * lisp/ruler-mode.el (ruler-mode-ruler, ruler-mode-window-col): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header) (tabulated-list-print-entry): Account for the width taken by line-number display. (Bug#27895) --- lisp/emacs-lisp/tabulated-list.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lisp/emacs-lisp/tabulated-list.el') diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index b6b49b1bfa2..8ff5cdf18e8 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -194,6 +194,8 @@ Populated by `tabulated-list-init-header'.") mouse-face highlight keymap ,tabulated-list-sort-button-map)) (cols nil)) + (if display-line-numbers + (setq x (+ x (line-number-display-width) 2))) (push (propertize " " 'display `(space :align-to ,x)) cols) (dotimes (n (length tabulated-list-format)) (let* ((col (aref tabulated-list-format n)) @@ -410,6 +412,8 @@ of column descriptors." (x (max tabulated-list-padding 0)) (ncols (length tabulated-list-format)) (inhibit-read-only t)) + (if display-line-numbers + (setq x (+ x (line-number-display-width) 2))) (if (> tabulated-list-padding 0) (insert (make-string x ?\s))) (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506). -- cgit v1.2.3