ui/doom: fix nav-flash triggers
Used to trigger when evil-multiedit was invoked, or on every keypress in eshell/term buffers (both caused by eager recenter-ing).
This commit is contained in:
parent
721b26d9f3
commit
1ce3f39529
1 changed files with 6 additions and 3 deletions
|
@ -95,9 +95,12 @@
|
||||||
(defun doom*blink-cursor-maybe (orig-fn &rest args)
|
(defun doom*blink-cursor-maybe (orig-fn &rest args)
|
||||||
"Blink line, to keep track of the cursor."
|
"Blink line, to keep track of the cursor."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((point (point-marker)))
|
(let ((point (save-excursion (goto-char (window-start))
|
||||||
|
(point-marker))))
|
||||||
(apply orig-fn args)
|
(apply orig-fn args)
|
||||||
(unless (equal point (point-marker))
|
(unless (equal point
|
||||||
|
(save-excursion (goto-char (window-start))
|
||||||
|
(point-marker)))
|
||||||
(doom/blink-cursor))))
|
(doom/blink-cursor))))
|
||||||
|
|
||||||
(defun doom/blink-cursor (&rest _)
|
(defun doom/blink-cursor (&rest _)
|
||||||
|
@ -112,7 +115,7 @@
|
||||||
#'doom/blink-cursor)
|
#'doom/blink-cursor)
|
||||||
|
|
||||||
(advice-add #'windmove-do-window-select :around #'doom*blink-cursor-maybe)
|
(advice-add #'windmove-do-window-select :around #'doom*blink-cursor-maybe)
|
||||||
(advice-add #'recenter :after #'doom/blink-cursor)
|
(advice-add #'recenter :around #'doom*blink-cursor-maybe)
|
||||||
|
|
||||||
(after! evil
|
(after! evil
|
||||||
(dolist (fn '(evil-window-bottom evil-window-middle evil-window-top))
|
(dolist (fn '(evil-window-bottom evil-window-middle evil-window-top))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue