Show :All if full buffer is visible
This commit is contained in:
parent
d23f975b25
commit
1d4fea774d
1 changed files with 10 additions and 4 deletions
|
@ -227,10 +227,16 @@
|
||||||
|
|
||||||
(spaceline-define-segment narf-buffer-position
|
(spaceline-define-segment narf-buffer-position
|
||||||
"A more vim-like buffer position."
|
"A more vim-like buffer position."
|
||||||
(let ((perc (/ (window-end) 0.01 (point-max))))
|
(let ((start (window-start))
|
||||||
(cond ((eq (window-start) 1) ":Top")
|
(end (window-end))
|
||||||
((>= perc 100) ":Bot")
|
(pend (point-max)))
|
||||||
(t (format ":%d%%%%" perc))))
|
(if (and (eq start 1)
|
||||||
|
(eq end pend))
|
||||||
|
":All"
|
||||||
|
(let ((perc (/ end 0.01 pend)))
|
||||||
|
(cond ((eq start 1) ":Top")
|
||||||
|
((>= perc 100) ":Bot")
|
||||||
|
(t (format ":%d%%%%" perc))))))
|
||||||
:tight-right t)
|
:tight-right t)
|
||||||
|
|
||||||
(spaceline-define-segment narf-vc
|
(spaceline-define-segment narf-vc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue