aboutsummaryrefslogtreecommitdiff
path: root/evil-ex.el
diff options
context:
space:
mode:
authorTom Dalziel <33435574+tomdl89@users.noreply.github.com>2021-07-24 00:22:29 +0200
committerGitHub <noreply@github.com>2021-07-24 00:22:29 +0200
commit566bc902732610471cb77e56639cf424a41745e7 (patch)
tree3bd16f29b23ddc40120d0c0d183dd973c8ed77c9 /evil-ex.el
parent6e4917d2fa96d8680df41a936c6dc49dc0dc1c41 (diff)
Add `*` ex-range for last visual range (#1500)
Diffstat (limited to 'evil-ex.el')
-rw-r--r--evil-ex.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/evil-ex.el b/evil-ex.el
index 709386e..c6a311f 100644
--- a/evil-ex.el
+++ b/evil-ex.el
@@ -65,6 +65,7 @@
((\? space) (\? "\\(?:.\\|\n\\)+") #'$2))
(range
("%" #'(evil-ex-full-range))
+ ("*" #'(evil-ex-last-visual-range))
(line ";" line #'(let ((tmp1 $1))
(save-excursion
(goto-line tmp1)
@@ -783,6 +784,10 @@ This function interprets special file names like # and %."
"Return a range encompassing the whole buffer."
(evil-range (point-min) (point-max) 'line))
+(defun evil-ex-last-visual-range ()
+ "Return a linewise range of the last visual selection."
+ (evil-line-expand evil-visual-mark evil-visual-point))
+
(defun evil-ex-marker (marker)
"Return MARKER's line number in the current buffer.
Signal an error if MARKER is in a different buffer."