Skip to content

Commit

Permalink
nav-flash: better mechanism on determining last point before blink
Browse files Browse the repository at this point in the history
This is ported from Doom Emacs.
  • Loading branch information
lebensterben committed Jul 26, 2022
1 parent fdfd9f1 commit 8e3686d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions layers/+misc/nav-flash/config.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;; config.el --- Nav-flash Layer Configuration File for Spacemacs.
;;; config.el --- Nav-flash Layer Configuration File for Spacemacs. -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2012-2022 Sylvain Benner & Contributors
;;
Expand Down Expand Up @@ -32,4 +32,4 @@
'(repeat symbol))

(defvar nav-flash--last-point nil
"Internal variable to store the last point and windoow before blinking.")
"Internal variable to store the active window, buffer, point before blinking.")
8 changes: 5 additions & 3 deletions layers/+misc/nav-flash/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ like switching windows or jumping to another part of the file)."
(unless (or (memq this-command nav-flash-exclude-commands)
(bound-and-true-p so-long-minor-mode)
(apply #'derived-mode-p nav-flash-exclude-modes)
(and (equal (point-marker) (car nav-flash--last-point))
(equal (selected-window) (cdr nav-flash--last-point))))
(equal nav-flash--last-point
(list (selected-window)
(current-buffer)
(point))))
(nav-flash//blink-cursor)
(setq nav-flash--last-point (cons (point-marker) (selected-window)))))
(setq nav-flash--last-point (list (selected-window) (current-buffer) (point)))))

(defun nav-flash/delayed-blink-cursor-h (&rest _)
"Like `nav-flash//blink-cursor', but blinks after a tiny pause.
Expand Down

0 comments on commit 8e3686d

Please sign in to comment.