core-ui: fix nlinum overlays after font changes
This commit is contained in:
parent
97dda290d9
commit
b5486e780e
1 changed files with 7 additions and 0 deletions
|
@ -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))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue