aboutsummaryrefslogtreecommitdiff
path: root/evil-common.el
diff options
context:
space:
mode:
authorTom Dalziel <tom_dl@hotmail.com>2022-04-30 22:05:47 +0100
committerTom Dalziel <tom_dl@hotmail.com>2022-04-30 22:43:52 +0100
commit8baa566fc23864da78b46a28c064ee9f937b7cf2 (patch)
tree5d179994086df9bac8d6fd11c7c17ce0d25f7ba6 /evil-common.el
parent03278456c300eb053ecf9652d98beada03589722 (diff)
Add `evil-select-inner-unrestricted-object`
Diffstat (limited to 'evil-common.el')
-rw-r--r--evil-common.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/evil-common.el b/evil-common.el
index 1518a4a..6b09cea 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -3102,7 +3102,7 @@ This can be overridden with TYPE."
(>= (evil-range-end range2)
(evil-range-end range1))))
-(defun evil-select-inner-object (thing beg end type &optional count line)
+(defun evil-select-inner-unrestricted-object (thing beg end type &optional count line)
"Return an inner text object range of COUNT objects.
If COUNT is positive, return objects following point; if COUNT is
negative, return objects preceding point. If one is unspecified,
@@ -3132,6 +3132,20 @@ linewise, otherwise it is character wise."
(if line 'line type)
:expanded t)))
+(defun evil-select-inner-object (thing beg end type &optional count line)
+ "Return an inner text object range of COUNT objects.
+Selection is restricted to the current line.
+If COUNT is positive, return objects following point; if COUNT is
+negative, return objects preceding point. If one is unspecified,
+the other is used with a negative argument. THING is a symbol
+understood by `thing-at-point'. BEG, END and TYPE specify the
+current selection. If LINE is non-nil, the text object should be
+linewise, otherwise it is character wise."
+ (save-restriction
+ (narrow-to-region (save-excursion (beginning-of-line) (point))
+ (save-excursion (end-of-line) (point)))
+ (evil-select-inner-unrestricted-object thing beg end type count line)))
+
(defun evil-select-an-object (thing beg end type count &optional line)
"Return an outer text object range of COUNT objects.
If COUNT is positive, return objects following point; if COUNT is