diff options
author | Eli Zaretskii <eliz@gnu.org> | 2017-08-05 14:22:04 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-08-05 14:22:04 +0300 |
commit | c3ac93bb9ff8b1fe1fc32f99c725e6cc209aa6ca (patch) | |
tree | cf2bb687be96accf6fb3b0c8e40fef7e00807264 /lisp/emacs-lisp | |
parent | 885c512603f946dfb7a45c181e94b8677be2678d (diff) | |
download | emacs-c3ac93bb9ff8b1fe1fc32f99c725e6cc209aa6ca.tar.gz emacs-c3ac93bb9ff8b1fe1fc32f99c725e6cc209aa6ca.tar.bz2 emacs-c3ac93bb9ff8b1fe1fc32f99c725e6cc209aa6ca.zip |
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)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/tabulated-list.el | 4 |
1 files changed, 4 insertions, 0 deletions
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). |