branch: elpa/evil
commit 1c836e4f9716961b498ee94aee965f16240a6823
Author: Konstantin Kharlamov <hi-an...@yandex.ru>
Commit: Tom Dalziel <33435574+tomd...@users.noreply.github.com>

    Restore `evil-select-inner-object` API
    
    Before commit
    
        04b25f6 Add `evil-select-inner-unrestricted-object`
    
    evil-select-inner-object was used for unrestricted selection. 04b25f6
    made this function restrict selection to a line, and introduced a new
    function evil-select-inner-unrestricted-object that works same way as
    evil-select-inner-object before.
    
    But evil-select-inner-object is an API that might be used by people in
    custom configuration, and changing behavior of the function would result
    in silent breakage.
    
    It is also worth noting that documentation at doc/source/extension.rst
    and doc/build/texinfo/evil.texi still mentions the older unrestricted
    behavior.
    
    So let's restore the original behavior of evil-select-inner-object by:
    
    1. Renaming evil-select-inner-object → evil-select-inner-restricted-object
    2. Renaming evil-select-inner-unrestricted-object → evil-select-inner-object
---
 evil-commands.el | 10 +++++-----
 evil-common.el   |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/evil-commands.el b/evil-commands.el
index 4cebc879b3..f1ba7aa573 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -1280,7 +1280,7 @@ or line COUNT to the top of the window."
 
 (evil-define-text-object evil-inner-word (count &optional beg end type)
   "Select inner word."
-  (evil-select-inner-object 'evil-word beg end type count))
+  (evil-select-inner-restricted-object 'evil-word beg end type count))
 
 (evil-define-text-object evil-a-WORD (count &optional beg end type)
   "Select a WORD."
@@ -1288,7 +1288,7 @@ or line COUNT to the top of the window."
 
 (evil-define-text-object evil-inner-WORD (count &optional beg end type)
   "Select inner WORD."
-  (evil-select-inner-object 'evil-WORD beg end type count))
+  (evil-select-inner-restricted-object 'evil-WORD beg end type count))
 
 (evil-define-text-object evil-a-symbol (count &optional beg end type)
   "Select a symbol."
@@ -1296,7 +1296,7 @@ or line COUNT to the top of the window."
 
 (evil-define-text-object evil-inner-symbol (count &optional beg end type)
   "Select inner symbol."
-  (evil-select-inner-unrestricted-object 'evil-symbol beg end type count))
+  (evil-select-inner-object 'evil-symbol beg end type count))
 
 (evil-define-text-object evil-a-sentence (count &optional beg end type)
   "Select a sentence."
@@ -1304,7 +1304,7 @@ or line COUNT to the top of the window."
 
 (evil-define-text-object evil-inner-sentence (count &optional beg end type)
   "Select inner sentence."
-  (evil-select-inner-unrestricted-object 'evil-sentence beg end type count))
+  (evil-select-inner-object 'evil-sentence beg end type count))
 
 (evil-define-text-object evil-a-paragraph (count &optional beg end type)
   "Select a paragraph."
@@ -1314,7 +1314,7 @@ or line COUNT to the top of the window."
 (evil-define-text-object evil-inner-paragraph (count &optional beg end type)
   "Select inner paragraph."
   :type line
-  (evil-select-inner-unrestricted-object 'evil-paragraph beg end type count t))
+  (evil-select-inner-object 'evil-paragraph beg end type count t))
 
 (evil-define-text-object evil-a-paren (count &optional beg end type)
   "Select a parenthesis."
diff --git a/evil-common.el b/evil-common.el
index 6b9f6944dc..8a2a5b929c 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -3109,7 +3109,7 @@ This can be overridden with TYPE."
        (>= (evil-range-end range2)
            (evil-range-end range1))))
 
-(defun evil-select-inner-unrestricted-object (thing beg end type &optional 
count line)
+(defun evil-select-inner-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,
@@ -3139,7 +3139,7 @@ linewise, otherwise it is character wise."
                 (if line 'line type)
                 :expanded t)))
 
-(defun evil-select-inner-object (thing beg end type &optional count line)
+(defun evil-select-inner-restricted-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
@@ -3151,7 +3151,7 @@ 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)))
+    (evil-select-inner-object thing beg end type count line)))
 
 (defun evil-select-an-unrestricted-object (thing beg end type count &optional 
line)
   "Return an outer text object range of COUNT objects.

Reply via email to