diff options
Diffstat (limited to 'emacs/.emacs.d/init.el')
-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 |