branch: elpa/evil commit cc55fa633d4f726953654326287abb9a233e0c90 Author: Tom Dalziel <tom...@hotmail.com> Commit: Tom Dalziel <33435574+tomd...@users.noreply.github.com>
Only look at mark when restoring point in visual state --- evil-ex.el | 6 ++++-- evil-tests.el | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/evil-ex.el b/evil-ex.el index 2546cc1c46..1cd65ff404 100644 --- a/evil-ex.el +++ b/evil-ex.el @@ -711,7 +711,9 @@ This function interprets special file names like # and %." (or range (and count (evil-ex-range count count)))) (evil-ex-command (evil-ex-completed-binding command)) (restore-point (when (evil-get-command-property evil-ex-command :restore-point) - (min (point) (or (mark) most-positive-fixnum)))) + (if (evil-visual-state-p) + (min (point) (or (mark) most-positive-fixnum)) + (point)))) (evil-ex-bang (and bang t)) (evil-ex-argument (copy-sequence argument)) (evil-this-type (evil-type evil-ex-range)) @@ -724,7 +726,7 @@ This function interprets special file names like # and %." (when evil-ex-reverse-range (setq evil-ex-reverse-range nil) (unless (y-or-n-p "Backward range given, OK to swap? ") - (user-error "Ex command cancelled"))) + (user-error ""))) (unwind-protect (cond ((not evil-ex-range) diff --git a/evil-tests.el b/evil-tests.el index d8951194ed..f6821be676 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -1955,7 +1955,15 @@ New Tex[t] (evil-test-buffer "[a]\nb\nc\nd\ne\n" (":+4y" [return] "p") - "a\n[e]\nb\nc\nd\ne\n"))) + "a\n[e]\nb\nc\nd\ne\n") + (evil-test-buffer + "1\n2\n3\n4\n5\n6\n7\n8\n9\n1[0]" + (":-5,.y") + "1\n2\n3\n4\n5\n6\n7\n8\n9\n1[0]") + (evil-test-buffer + "1\n2\n3\n4\n[5]\n6\n7\n8\n9\n10" + ("my" "G" ":'y,.y") + "1\n2\n3\n4\n5\n6\n7\n8\n9\n[1]0"))) (ert-deftest evil-test-delete () "Test `evil-delete'"