Skip to content

Commit

Permalink
Call evil--ex-update one last time in minibuffer teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Dec 14, 2024
1 parent ebc7854 commit 52f4914
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions evil-ex.el
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,6 @@ actions during Ex state."
(add-hook 'minibuffer-exit-hook #'evil-ex-teardown nil t)
(add-hook 'completion-at-point-functions #'evil-ex-completion-at-point nil t))

(defun evil-ex-teardown ()
"Deinitialize Ex minibuffer.
Clean up everything set up by `evil-ex-setup'."
(let ((runner (evil-ex-argument-handler-runner evil--ex-argument-handler)))
(when runner (funcall runner 'stop))))
(put 'evil-ex-teardown 'permanent-local-hook t)

(defsubst evil--ex-bang-p (command)
"Return non-nil if the string COMMAND has a \"!\" suffix."
(and (> (length command) 1) (eq (aref command (1- (length command))) ?!)))
Expand Down Expand Up @@ -469,6 +462,15 @@ in case of incomplete or unknown commands."
(cond ((stringp prefix) (evil-ex-echo "Incomplete command"))
((null prefix) (evil-ex-echo "Unknown command")))))))))

(defun evil-ex-teardown ()
"Deinitialize Ex minibuffer.
Clean up everything set up by `evil-ex-setup'."
;; Call ex--update one last time, in case after-change-functions are combined
(evil--ex-update nil nil nil (minibuffer-contents-no-properties))
(let ((runner (evil-ex-argument-handler-runner evil--ex-argument-handler)))
(when runner (funcall runner 'stop))))
(put 'evil-ex-teardown 'permanent-local-hook t)

(defvar-local evil--ex-echo-overlay nil
"Overlay for displaying info messages during Ex.")

Expand Down

0 comments on commit 52f4914

Please sign in to comment.