mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-30 11:09:55 +00:00
Fix #62: disregards value of column-number-indicator-zero-based.
Same as mode-line-percent-position.
This commit is contained in:
parent
44a46a61cc
commit
21637ad560
1 changed files with 19 additions and 2 deletions
|
@ -1362,15 +1362,32 @@ Requires `eyebrowse-mode' to be enabled."
|
||||||
|
|
||||||
;; Be compatible with Emacs 25.
|
;; Be compatible with Emacs 25.
|
||||||
(defvar-local doom-modeline-column-zero-based
|
(defvar-local doom-modeline-column-zero-based
|
||||||
(or (bound-and-true-p column-number-indicator-zero-based) t)
|
(if (boundp 'column-number-indicator-zero-based)
|
||||||
|
column-number-indicator-zero-based
|
||||||
|
t)
|
||||||
"When non-nil, mode line displays column numbers zero-based.
|
"When non-nil, mode line displays column numbers zero-based.
|
||||||
See `column-number-indicator-zero-based'.")
|
See `column-number-indicator-zero-based'.")
|
||||||
|
|
||||||
(defvar-local doom-modeline-percent-position
|
(defvar-local doom-modeline-percent-position
|
||||||
(or (bound-and-true-p mode-line-percent-position) '(-3 "%p"))
|
(if (boundp 'mode-line-percent-position)
|
||||||
|
mode-line-percent-position
|
||||||
|
'(-3 "%p"))
|
||||||
"Specification of \"percentage offset\" of window through buffer.
|
"Specification of \"percentage offset\" of window through buffer.
|
||||||
See `mode-line-percent-position'.")
|
See `mode-line-percent-position'.")
|
||||||
|
|
||||||
|
(when (>= emacs-major-version 26)
|
||||||
|
(add-variable-watcher
|
||||||
|
'column-number-indicator-zero-based
|
||||||
|
(lambda (_sym val op _where)
|
||||||
|
(when (eq op 'set)
|
||||||
|
(setq doom-modeline-column-zero-based val))))
|
||||||
|
|
||||||
|
(add-variable-watcher
|
||||||
|
'mode-line-percent-position
|
||||||
|
(lambda (_sym val op _where)
|
||||||
|
(when (eq op 'set)
|
||||||
|
(setq doom-modeline-percent-position val)))))
|
||||||
|
|
||||||
(setq-default mode-line-position
|
(setq-default mode-line-position
|
||||||
'((line-number-mode
|
'((line-number-mode
|
||||||
(column-number-mode
|
(column-number-mode
|
||||||
|
|
Loading…
Reference in a new issue