Refactor line number implementation
+ Add relative line number support (see doom-line-numbers-style) + Update doom/toggle-line-numbers + New hook functions: doom|enable-line-numbers, doom|disable-line-numbers Addresses #156
This commit is contained in:
parent
3bf876f44e
commit
f2d8681ef4
4 changed files with 123 additions and 88 deletions
|
@ -14,11 +14,14 @@
|
|||
"Toggle `linum-mode'."
|
||||
(interactive "P")
|
||||
(cond ((boundp 'display-line-numbers)
|
||||
(setq display-line-numbers (not display-line-numbers)))
|
||||
(setq display-line-numbers
|
||||
(pcase arg
|
||||
('(4) 'relative)
|
||||
(1 t)
|
||||
(-1 nil)
|
||||
(_ (not display-line-numbers)))))
|
||||
((featurep 'nlinum)
|
||||
(nlinum-mode (or arg (if nlinum-mode -1 +1))))
|
||||
((featurep 'linum)
|
||||
(linum-mode (or arg (if linum-mode -1 +1))))
|
||||
(t
|
||||
(error "No line number plugin detected"))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue