line numbers ACTUALLY refresh all the time

This commit is contained in:
MitchMarq42 2022-12-14 22:26:37 -09:00
parent bbf3e34c90
commit 0d9d78f44e

View File

@ -349,6 +349,8 @@ targets."
:hook (prog-mode . nlinum-relative-mode) :hook (prog-mode . nlinum-relative-mode)
:init :init
(defun mitch/nlinum-buffer-setup () (defun mitch/nlinum-buffer-setup ()
(nlinum-relative-mode -1)
(nlinum-relative-mode 99)
(setq nlinum-format-function (setq nlinum-format-function
(lambda (line width) (lambda (line width)
(let* ((line-display (abs (- line nlinum-relative--current-line))) (let* ((line-display (abs (- line nlinum-relative--current-line)))
@ -373,7 +375,7 @@ targets."
str))) str)))
(setq-local nlinum--width (length (number-to-string (setq-local nlinum--width (length (number-to-string
(line-number-at-pos (point-max)))))) (line-number-at-pos (point-max))))))
(add-hook 'minibuffer-exit-hook #'mitch/nlinum-buffer-setup)) (add-hook 'focus-in-hook #'mitch/nlinum-buffer-setup))
;; broken terminal that doesn't compile but at least it's fast when it does ;; broken terminal that doesn't compile but at least it's fast when it does
(elpaca-use-package vterm (elpaca-use-package vterm