summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-11-19 21:06:34 -0500
committerDavid Robillard <d@drobilla.net>2021-11-19 21:06:34 -0500
commit24b27aaecb82ffca2acbb0378aba822f06a78f7f (patch)
tree585d24041ba1ca301e38ffa3d4e904056014066f
parent417b8a21a730e1a9d8e27d49223aafbbecff0921 (diff)
downloaddotfiles-24b27aaecb82ffca2acbb0378aba822f06a78f7f.tar.gz
dotfiles-24b27aaecb82ffca2acbb0378aba822f06a78f7f.tar.bz2
dotfiles-24b27aaecb82ffca2acbb0378aba822f06a78f7f.zip
Fix unstable width of right hand mode line segments
-rw-r--r--emacs/.emacs.d/init.el21
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