summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-09 17:57:12 +0100
committerDavid Robillard <d@drobilla.net>2017-12-09 17:57:12 +0100
commit072adabf19ef9d5df4675ae0eb645a555f3c2f84 (patch)
tree3f1186b3ed22f0bba83ce5059d6f0a0a301ab38c
parent743cb2e2c0de2b3bc4033a93613fb3e62ce38fed (diff)
downloaddotfiles-072adabf19ef9d5df4675ae0eb645a555f3c2f84.tar.gz
dotfiles-072adabf19ef9d5df4675ae0eb645a555f3c2f84.tar.bz2
dotfiles-072adabf19ef9d5df4675ae0eb645a555f3c2f84.zip
Fix numerical error on empty buffers
-rw-r--r--emacs.d/init.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el
index 3d475bf..5c60dbe 100644
--- a/emacs.d/init.el
+++ b/emacs.d/init.el
@@ -99,7 +99,7 @@
(spaceline-define-segment buffer-position
"Buffer position in percent"
(format "%3d%%%%" (/ (* 100 (- (line-number-at-pos) 1))
- (count-lines (point-min) (point-max)))))
+ (max 1 (count-lines (point-min) (point-max))))))
;;; Variables