fix: dynamically adjust line wrap to line number width

This commit is contained in:
Kiana Sheibani 2025-04-03 06:18:02 -04:00
parent b110f19584
commit 8a74b84b35
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -1467,9 +1467,13 @@ When a buffer has line numbers, they can interfere with the margins and make the
#+begin_src emacs-lisp
(add-hook! display-line-numbers-mode
(require 'visual-fill-column)
(when visual-fill-column-mode
(setq-local visual-fill-column-extra-text-width '(0 . 6))
(visual-fill-column--adjust-window)))
(setq-local
visual-fill-column-extra-text-width
(cons 0 (if display-line-numbers-mode
;; Width of line number + 2 padding columns
(+ 2 (line-number-display-width))
0)))
(visual-fill-column--adjust-window))
#+end_src
** Dashboard