Skip to content

Commit

Permalink
(history) move git-timemachine init to pre-entry hook
Browse files Browse the repository at this point in the history
This still ends up setting the evil state in the original buffer rather
than the timemachine buffer, though the evil state is set post-entry.
Not sure why.

Note the evil state is purely for UI feedback purposes and has no
functional effect.
  • Loading branch information
countvajhula committed Sep 11, 2024
1 parent 6f99d62 commit 7524136
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rigpa-history-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@
:lighter " history"
:group 'rigpa)

(defun rigpa--on-history-mode-pre-entry ()
"Pre-entry"
(unless git-timemachine-mode
(git-timemachine)))

(defun rigpa--on-history-mode-entry ()
"Actions to take upon entry into history mode."
(unless git-timemachine-mode
(git-timemachine))
;; TODO: probably do this via a standard internal
;; rigpa hook in mode registration
(evil-history-state))
Expand Down
1 change: 1 addition & 0 deletions rigpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
:post-entry #'rigpa--on-activity-mode-entry
:post-exit #'rigpa--on-activity-mode-post-exit)
(rigpa-register-mode chimera-history-mode
:pre-entry #'rigpa--on-history-mode-pre-entry
:post-entry #'rigpa--on-history-mode-entry
:post-exit #'rigpa--on-history-mode-post-exit)
(rigpa-register-mode chimera-tab-mode
Expand Down

0 comments on commit 7524136

Please sign in to comment.