From 05714e8daacadb7603a05ffe81d1fbda7439a748 Mon Sep 17 00:00:00 2001 From: Tom Dalziel Date: Wed, 13 Apr 2022 23:06:09 +0100 Subject: 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 b375a74..491eef0 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 2836f22..b0d2ce1 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 () -- cgit v1.0