ui/nav-flash: factor out redundancy

This commit is contained in:
Henrik Lissner 2019-11-03 16:27:17 -05:00
parent 633fd7c95f
commit a93f097f78
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 3 additions and 4 deletions

View file

@ -16,11 +16,10 @@ jumping to another part of the file)."
(defun +nav-flash-blink-cursor-maybe (&rest _)
"Like `+nav-flash-blink-cursor', but no-ops if in special-mode or term-mode,
or triggered from one of `+nav-flash-exclude-commands'."
(unless (or (memq this-command '(mouse-drag-region evil-mouse-drag-region))
(unless (or (memq this-command +nav-flash-exclude-commands)
(bound-and-true-p so-long-minor-mode)
(eq major-mode 'so-long-mode)
(derived-mode-p 'special-mode 'term-mode)
(memq this-command +nav-flash-exclude-commands)
(and (equal (point-marker) (car +nav-flash--last-point))
(equal (selected-window) (cdr +nav-flash--last-point))))
(+nav-flash-blink-cursor)

View file

@ -1,8 +1,8 @@
;;; 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)
'(mouse-set-point mouse-drag-region 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.")
(use-package! nav-flash