diff options
author | David Robillard <d@drobilla.net> | 2021-11-19 21:06:34 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-11-19 21:06:34 -0500 |
commit | 24b27aaecb82ffca2acbb0378aba822f06a78f7f (patch) | |
tree | 585d24041ba1ca301e38ffa3d4e904056014066f /emacs | |
parent | 417b8a21a730e1a9d8e27d49223aafbbecff0921 (diff) | |
download | dotfiles-24b27aaecb82ffca2acbb0378aba822f06a78f7f.tar.gz dotfiles-24b27aaecb82ffca2acbb0378aba822f06a78f7f.tar.bz2 dotfiles-24b27aaecb82ffca2acbb0378aba822f06a78f7f.zip |
Fix unstable width of right hand mode line segments
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 8a40931..84d4220 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -151,9 +151,19 @@ (spaceline-define-segment buffer-position "Buffer position in percent" - (format "%3d%%%% " (/ (* 100 (- (line-number-at-pos) 1)) + (format "%3d%%%% " (/ (* 100 (- (line-number-at-pos) 1)) (max 1 (count-lines (point-min) (point-max)))))) +(spaceline-define-segment line-column + "The current line and column numbers." + (if (eq major-mode 'pdf-view-mode) + ;; Show page number and count for PDF documents + (concat (number-to-string (pdf-view-current-page)) + "/" + (number-to-string (pdf-cache-number-of-pages))) + mode-line-position + "%l :%2c")) + (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) ;;; Variables @@ -516,15 +526,6 @@ (add-hook 'doc-view-mode-hook 'my-doc-view-hook) (add-hook 'pdf-view-mode-hook 'my-doc-view-hook) -(spaceline-define-segment line-column - "The current line and column numbers." - (if (eq major-mode 'pdf-view-mode) - ;; Show page number and count for PDF documents - (concat (number-to-string (pdf-view-current-page)) - "/" - (number-to-string (pdf-cache-number-of-pages))) - mode-line-position - "%l:%c")) ;; Associations |