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
This commit is contained in:
parent
45310f1c3e
commit
6d9a7e9a8f
1 changed files with 3 additions and 2 deletions
|
@ -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)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue