Skip to content

Commit 35fe630

Browse files
committed
Call evil--ex-update one last time in minibuffer teardown
Fixes #1941
1 parent ebc7854 commit 35fe630

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

evil-ex.el

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,6 @@ actions during Ex state."
412412
(add-hook 'minibuffer-exit-hook #'evil-ex-teardown nil t)
413413
(add-hook 'completion-at-point-functions #'evil-ex-completion-at-point nil t))
414414

415-
(defun evil-ex-teardown ()
416-
"Deinitialize Ex minibuffer.
417-
Clean up everything set up by `evil-ex-setup'."
418-
(let ((runner (evil-ex-argument-handler-runner evil--ex-argument-handler)))
419-
(when runner (funcall runner 'stop))))
420-
(put 'evil-ex-teardown 'permanent-local-hook t)
421-
422415
(defsubst evil--ex-bang-p (command)
423416
"Return non-nil if the string COMMAND has a \"!\" suffix."
424417
(and (> (length command) 1) (eq (aref command (1- (length command))) ?!)))
@@ -469,6 +462,15 @@ in case of incomplete or unknown commands."
469462
(cond ((stringp prefix) (evil-ex-echo "Incomplete command"))
470463
((null prefix) (evil-ex-echo "Unknown command")))))))))
471464

465+
(defun evil-ex-teardown ()
466+
"Deinitialize Ex minibuffer.
467+
Clean up everything set up by `evil-ex-setup'."
468+
;; Call ex--update one last time, in case after-change-functions are combined
469+
(evil--ex-update nil nil nil (minibuffer-contents-no-properties))
470+
(let ((runner (evil-ex-argument-handler-runner evil--ex-argument-handler)))
471+
(when runner (funcall runner 'stop))))
472+
(put 'evil-ex-teardown 'permanent-local-hook t)
473+
472474
(defvar-local evil--ex-echo-overlay nil
473475
"Overlay for displaying info messages during Ex.")
474476

0 commit comments

Comments
 (0)