Skip to content

Commit

Permalink
fix: bug where this-command is nil
Browse files Browse the repository at this point in the history
This bug was introduce after switching to `track-changes`
library. This is because we've relinquished control for when
parinfer-rust-execute is called. `track-changes` calls it whenever it
feels like it. That means `parinfer-rust-execute` can be called during
a command execution, or after. We still have to prefer `this-command`
first, because `last-command` has out of date information if
`this-command` is not nil.
  • Loading branch information
justinbarclay committed Oct 21, 2024
1 parent c4cff06 commit c2a4d4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parinfer-rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,9 @@ CHANGES."
(let* ((parinfer-rust--mode
(if-let ((mode
(and (string= "smart" parinfer-rust--mode)
(alist-get this-command parinfer-rust-treat-command-as))))
(alist-get (or this-command
last-command)
parinfer-rust-treat-command-as))))
(progn
;; By saying a command should run under another mode, we're
;; going to simplify parinfer-rust's behavior and clear all
Expand Down

0 comments on commit c2a4d4f

Please sign in to comment.