From 99ff48d1d36ada2032199f97a40c5087722b5503 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Wed, 4 Feb 2026 17:17:45 -0500 Subject: [PATCH] fix(visual-fill-column): only trigger hook when active --- config.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 083fca3..72a38c7 100644 --- a/config.org +++ b/config.org @@ -1311,7 +1311,7 @@ The =visual-fill-column= package works by expanding the window's right margin. T When a buffer has line numbers, they can interfere with the margins and make the line smaller than it should be. We can mitigate this issue by adding extra columns to the window. #+begin_src emacs-lisp -(defun ~/update-visual-fill-column-line-numbers (&optional _s _e _len) +(defun ~/update-visual-fill-column-line-numbers () (require 'visual-fill-column) (let ((dw (line-number-display-width))) ;; 2 extra columns for padding (when line numbers are on) @@ -1320,7 +1320,7 @@ When a buffer has line numbers, they can interfere with the margins and make the (unless (= dw (or (cdr visual-fill-column-extra-text-width) 0)) (setq-local visual-fill-column-extra-text-width (cons 0 dw)) - (visual-fill-column--adjust-window)))) + (visual-fill-column-adjust)))) (add-hook! '(display-line-numbers-mode-hook post-command-hook doom-switch-buffer-hook) #'~/update-visual-fill-column-line-numbers)