emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-escape 8af69d73f8 020/133: Fixes #10 deleting with `d


From: ELPA Syncer
Subject: [nongnu] elpa/evil-escape 8af69d73f8 020/133: Fixes #10 deleting with `df)` does not include `)`
Date: Wed, 3 Jan 2024 21:59:49 -0500 (EST)

branch: elpa/evil-escape
commit 8af69d73f8192fbd12fdc96c3a1e7a67a1bf65b1
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>

    Fixes #10 deleting with `df)` does not include `)`
---
 evil-escape.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/evil-escape.el b/evil-escape.el
index 13be3db7de..077ac86a60 100644
--- a/evil-escape.el
+++ b/evil-escape.el
@@ -223,6 +223,12 @@ with a key sequence."
   (let* ((insertp (not buffer-read-only)))
     (delete-char -1)))
 
+(defun evil-escape--call-evil-function (func)
+  "Call the passed evil function appropriatly."
+  (if (eq 'inclusive (evil-get-command-property func :type))
+      (setq evil-this-type 'inclusive))
+  (call-interactively shadowed-func))
+
 (evil-define-command evil-escape--escape
   (keys shadowed-func insert? delete? callback &optional insert-func 
delete-func)
   "Execute the passed CALLBACK using KEYS. KEYS is a cons cell of 2 characters.
@@ -238,7 +244,7 @@ If DELETE? is not nil then the first key is deleted using 
the function
 DELETE-FUNC when calling CALLBACK. "
   :repeat nil
   (if (and shadowed-func (eq 'normal evil-state))
-      (call-interactively shadowed-func)
+      (evil-escape--call-evil-function shadowed-func)
     (let* ((modified (buffer-modified-p))
            (insertf (if insert-func
                         insert-func 'evil-escape--default-insert-func))
@@ -252,7 +258,7 @@ DELETE-FUNC when calling CALLBACK. "
         (cond
          ((null evt)
           (unless (eq 'insert evil-state)
-            (if shadowed-func (call-interactively shadowed-func))))
+            (if shadowed-func (evil-escape--call-evil-function 
shadowed-func))))
          ((and (integerp evt)
                (char-equal evt skey))
           ;; remove the f character
@@ -262,7 +268,8 @@ DELETE-FUNC when calling CALLBACK. "
          (t ; otherwise
           (setq unread-command-events
                 (append unread-command-events (list evt)))
-          (if shadowed-func (call-interactively shadowed-func))))))))
+          (if shadowed-func (evil-escape--call-evil-function shadowed-func)))))
+      )))
 
 (provide 'evil-escape)
 ;;; evil-escape.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]