mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
core-ui: fix nlinum overlays after font changes
This commit is contained in:
@ -186,6 +186,13 @@ file."
|
|||||||
'nlinum-mode)
|
'nlinum-mode)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
(defun doom*nlinum-flush (&rest _)
|
||||||
|
"Fix nlinum margins after a change in font."
|
||||||
|
(dolist (buffer (doom-visible-buffers))
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(when nlinum-mode (nlinum--flush)))))
|
||||||
|
(advice-add 'set-frame-font :after 'doom*nlinum-flush)
|
||||||
|
|
||||||
;; Optimization: calculate line number column width beforehand
|
;; Optimization: calculate line number column width beforehand
|
||||||
(add-hook! nlinum-mode
|
(add-hook! nlinum-mode
|
||||||
(setq nlinum--width (length (save-excursion (goto-char (point-max))
|
(setq nlinum--width (length (save-excursion (goto-char (point-max))
|
||||||
|
Reference in New Issue
Block a user