Refactor doom/toggle-line-numbers; add doom-line-numbers-visual-style #376

doom-line-numbers-visual-style adds support for the visual
display-line-numbers mode by setting it to a non-nil value.
This commit is contained in:
Henrik Lissner 2018-01-30 03:27:38 -05:00
parent 64a674dcc9
commit bcef66b947
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 22 additions and 8 deletions

View file

@ -319,9 +319,8 @@ DEFAULT is non-nil, set the default mode-line for all buffers."
;;
(defvar doom-line-numbers-style t
"The default styles to use for the line number display.
Takes the same argument as `display-line-numbers' in Emacs 26, which are:
"The default styles to use for the line number display. Accepts one of the
following:
nil No line numbers
t Ordinary line numbers
@ -329,6 +328,14 @@ Takes the same argument as `display-line-numbers' in Emacs 26, which are:
Use `doom/toggle-line-numbers' to cycle between these line number styles.")
(when (boundp 'display-line-numbers)
(defvar doom-line-numbers-visual-style nil
"If non-nil, relative line numbers will be countered by screen line, rather
than buffer line. Setting this to non-nil is the equivalent of using 'visual in
`display-line-numbers'.
It has no effect on nlinum."))
(defun doom|enable-line-numbers (&optional arg)
"Enables the display of line numbers, using `display-line-numbers' (in Emacs
26+) or `nlinum-mode'.