Fix #4206: hl-line reactivates on exiting visual mode

This commit is contained in:
Henrik Lissner 2020-11-03 16:14:24 -05:00
parent 41885c4e72
commit 9f261788b9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -402,11 +402,16 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
;; serve much purpose when the selection is so much more visible.
(defvar doom--hl-line-mode nil)
(add-hook! 'hl-line-mode-hook
(defun doom-truly-disable-hl-line-h ()
(unless hl-line-mode
(setq-local doom--hl-line-mode nil))))
(add-hook! '(evil-visual-state-entry-hook activate-mark-hook)
(defun doom-disable-hl-line-h ()
(when hl-line-mode
(setq-local doom--hl-line-mode t)
(hl-line-mode -1))))
(hl-line-mode -1)
(setq-local doom--hl-line-mode t))))
(add-hook! '(evil-visual-state-exit-hook deactivate-mark-hook)
(defun doom-enable-hl-line-maybe-h ()