branch: elpa/evil
commit 35fe630b3227bb44c54df0c4a265c3a5e151331a
Author: Tom Dalziel <tom...@hotmail.com>
Commit: Tom Dalziel <33435574+tomd...@users.noreply.github.com>

    Call evil--ex-update one last time in minibuffer teardown
    
    Fixes #1941
---
 evil-ex.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/evil-ex.el b/evil-ex.el
index f400036cb6..db17019c26 100644
--- a/evil-ex.el
+++ b/evil-ex.el
@@ -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))) ?!)))
@@ -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.")
 

Reply via email to