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

    Ensure we're not in visual state if there's no ex range
    
    fixes #1595
---
 evil-ex.el    | 1 +
 evil-tests.el | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/evil-ex.el b/evil-ex.el
index b375a74455..491eef0858 100644
--- a/evil-ex.el
+++ b/evil-ex.el
@@ -718,6 +718,7 @@ This function interprets special file names like # and %."
           (cond
            ((not evil-ex-range)
             (setq this-command evil-ex-command)
+            (evil-exit-visual-state)
             (run-hooks 'pre-command-hook)
             (call-interactively evil-ex-command)
             (run-hooks 'post-command-hook))
diff --git a/evil-tests.el b/evil-tests.el
index 2836f22751..b0d2ce1c08 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -8386,6 +8386,11 @@ Source
     (evil-test-buffer
       "5\n4\n3\n2\n1\n"
       (":g/^/m0")
+      "1\n2\n3\n4\n5\n"))
+  (ert-info ("Move with global, and visual selection")
+    (evil-test-buffer
+      "<5\n4\n3\n2\n[1]>\n"
+      (":g/^/m0")
       "1\n2\n3\n4\n5\n")))
 
 (ert-deftest evil-test-write ()

Reply via email to