Refactor detection of native display-line-numbers
This commit is contained in:
parent
da7f9019d1
commit
9a4cce8d9a
3 changed files with 6 additions and 4 deletions
|
@ -26,6 +26,8 @@ relative number of a line.
|
||||||
Lisp programs can disable display of a line number of a particular
|
Lisp programs can disable display of a line number of a particular
|
||||||
buffer line by putting the display-line-numbers-disable text property
|
buffer line by putting the display-line-numbers-disable text property
|
||||||
or overlay property on the first visible character of that line.")
|
or overlay property on the first visible character of that line.")
|
||||||
|
;;;###autoload
|
||||||
|
(put 'display-line-numbers 'nlinum t)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defcustom display-line-numbers-type t
|
(defcustom display-line-numbers-type t
|
||||||
|
|
|
@ -304,7 +304,7 @@ from the default."
|
||||||
;; Line number column. A faster (or equivalent, in the worst case) line number
|
;; Line number column. A faster (or equivalent, in the worst case) line number
|
||||||
;; plugin than `linum-mode'.
|
;; plugin than `linum-mode'.
|
||||||
(def-package! nlinum
|
(def-package! nlinum
|
||||||
:unless (boundp 'display-line-numbers)
|
:when (get 'display-line-numbers 'nlinum)
|
||||||
:commands nlinum-mode
|
:commands nlinum-mode
|
||||||
:init
|
:init
|
||||||
(defvar doom-line-number-lpad 4
|
(defvar doom-line-number-lpad 4
|
||||||
|
@ -352,7 +352,7 @@ character that looks like a space that `whitespace-mode' won't affect.")
|
||||||
|
|
||||||
;; Fixes disappearing line numbers in nlinum and other quirks
|
;; Fixes disappearing line numbers in nlinum and other quirks
|
||||||
(def-package! nlinum-hl
|
(def-package! nlinum-hl
|
||||||
:unless (boundp 'display-line-numbers)
|
:when (get 'display-line-numbers 'nlinum)
|
||||||
:after nlinum
|
:after nlinum
|
||||||
:config
|
:config
|
||||||
;; With `markdown-fontify-code-blocks-natively' enabled in `markdown-mode',
|
;; With `markdown-fontify-code-blocks-natively' enabled in `markdown-mode',
|
||||||
|
@ -367,7 +367,7 @@ character that looks like a space that `whitespace-mode' won't affect.")
|
||||||
(advice-add #'set-frame-font :after #'nlinum-hl-flush-all-windows))
|
(advice-add #'set-frame-font :after #'nlinum-hl-flush-all-windows))
|
||||||
|
|
||||||
(def-package! nlinum-relative
|
(def-package! nlinum-relative
|
||||||
:unless (boundp 'display-line-numbers)
|
:when (get 'display-line-numbers 'nlinum)
|
||||||
:commands (nlinum-relative-mode nlinum-relative-on nlinum-relative-off)
|
:commands (nlinum-relative-mode nlinum-relative-on nlinum-relative-off)
|
||||||
:config
|
:config
|
||||||
(setq nlinum-format " %d ")
|
(setq nlinum-format " %d ")
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
(package! highlight-numbers)
|
(package! highlight-numbers)
|
||||||
(package! highlight-escape-sequences
|
(package! highlight-escape-sequences
|
||||||
:recipe (:fetcher github :repo "hlissner/highlight-escape-sequences"))
|
:recipe (:fetcher github :repo "hlissner/highlight-escape-sequences"))
|
||||||
(unless (boundp 'display-line-numbers)
|
(unless (locate-library "display-line-numbers")
|
||||||
(package! nlinum)
|
(package! nlinum)
|
||||||
(package! nlinum-hl)
|
(package! nlinum-hl)
|
||||||
(package! nlinum-relative))
|
(package! nlinum-relative))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue