fix: dynamically adjust line wrap to line number width
This commit is contained in:
parent
b110f19584
commit
8a74b84b35
1 changed files with 7 additions and 3 deletions
10
config.org
10
config.org
|
|
@ -1467,9 +1467,13 @@ When a buffer has line numbers, they can interfere with the margins and make the
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(add-hook! display-line-numbers-mode
|
(add-hook! display-line-numbers-mode
|
||||||
(require 'visual-fill-column)
|
(require 'visual-fill-column)
|
||||||
(when visual-fill-column-mode
|
(setq-local
|
||||||
(setq-local visual-fill-column-extra-text-width '(0 . 6))
|
visual-fill-column-extra-text-width
|
||||||
(visual-fill-column--adjust-window)))
|
(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
|
#+end_src
|
||||||
|
|
||||||
** Dashboard
|
** Dashboard
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue