From 6d9a7e9a8fa061634f6a3008a999f2b2d1172287 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 5 Sep 2024 15:03:39 -0400 Subject: [PATCH] fix: over-aggressive deactivation of hl-line-mode `(de?)activate-mark-hook` is triggered a little too often in too many edge cases where the user isn't interactively selecting a region. One annoying edge case has non-evil motions used on evil operators activating but not deactivating the mark (e.g. #8047). This leaves non-evil users without the nicety of hl-line auto-disabling itself when the region is active, but I'll revisit that in v3.0, when most of these package defaults are moved out to modules. Fix: #8047 --- lisp/doom-ui.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 4ca274457..847f5301f 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -388,13 +388,14 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (unless hl-line-mode (setq-local doom--hl-line-mode nil)))) - (add-hook! '(evil-visual-state-entry-hook activate-mark-hook) + ;; TODO: Use (de)activate-mark-hook in the absence of evil + (add-hook! 'evil-visual-state-entry-hook (defun doom-disable-hl-line-h () (when hl-line-mode (hl-line-mode -1) (setq-local doom--hl-line-mode t)))) - (add-hook! '(evil-visual-state-exit-hook deactivate-mark-hook) + (add-hook! 'evil-visual-state-exit-hook (defun doom-enable-hl-line-maybe-h () (when doom--hl-line-mode (hl-line-mode +1)))))