ui/nav-flash: refactor

+ Add +nav-flash-exclude-commands to control where
  +nav-flash-blink-cursor-maybe should not trigger nav-flash.
+ Rename API to conform to Doom naming conventions
  + +nav-flash-blink-cursor
  + +nav-flash-blink-cursor-maybe
  + +nav-flash|delayed-blink-cursor
  + +nav-flash|blink-cursor
  + +nav-flash|blink-cursor-maybe
  + +nav-flash*blink-cursor
This commit is contained in:
Henrik Lissner 2018-07-24 20:04:03 +02:00
parent ebd3b0223e
commit f58f3c3604
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 45 additions and 21 deletions

View file

@ -1,5 +1,10 @@
;;; ui/nav-flash/config.el -*- lexical-binding: t; -*-
(defvar +nav-flash-exclude-commands
'(mouse-set-point evil-mouse-drag-region
+org/dwim-at-point org-find-file org-find-file-at-mouse)
"A list of commands that should not trigger nav-flash.")
(def-package! nav-flash
:defer t
:init
@ -9,13 +14,16 @@
'(doom-enter-window-hook
imenu-after-jump-hook evil-jumps-post-jump-hook
counsel-grep-post-action-hook dumb-jump-after-jump-hook)
#'+nav-flash/blink-cursor)
#'+nav-flash|blink-cursor-maybe)
;; `org'
(add-hook 'org-follow-link-hook #'+nav-flash|delayed-blink-cursor)
;; `saveplace'
(advice-add #'save-place-find-file-hook :after #'+nav-flash/blink-cursor)
(advice-add #'save-place-find-file-hook :after #'+nav-flash*blink-cursor)
;; `evil'
(advice-add #'evil-window-top :after #'+nav-flash/blink-cursor)
(advice-add #'evil-window-middle :after #'+nav-flash/blink-cursor)
(advice-add #'evil-window-bottom :after #'+nav-flash/blink-cursor))
(advice-add #'evil-window-top :after #'+nav-flash*blink-cursor)
(advice-add #'evil-window-middle :after #'+nav-flash*blink-cursor)
(advice-add #'evil-window-bottom :after #'+nav-flash*blink-cursor))