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

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

[elpa] master 58e8636 070/110: avy.el (avy-action-zap-to-char): More con


From: Oleh Krehel
Subject: [elpa] master 58e8636 070/110: avy.el (avy-action-zap-to-char): More convenient use-cases
Date: Sat, 11 May 2019 10:15:46 -0400 (EDT)

branch: master
commit 58e8636d32d0e0a987f60e1620787951f31d0020
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    avy.el (avy-action-zap-to-char): More convenient use-cases
    
    Use case 1:
    
    Start (cursor is |):
    
        This is my sentence and |there is some description
    
    avy-goto-char "d" in description, action "z" results in:
    
        This is my sentence and |description
    
    Use case 2:
    
    Same start;
    
    avy-goto-char "t" in "This", action "z" results in:
    
        |there is some description
    
    The nice thing is that the both sequences are reversible with "C-y".
    
    Fixes #234.
---
 avy.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/avy.el b/avy.el
index 3fc645e..6835e91 100644
--- a/avy.el
+++ b/avy.el
@@ -691,8 +691,8 @@ Set `avy-style' according to COMMMAND as well."
 (defun avy-action-zap-to-char (pt)
   "Kill from point up to PT."
   (if (> pt (point))
-      (kill-region (point) (1+ pt))
-    (kill-region pt (1+ (point)))))
+      (kill-region (point) pt)
+    (kill-region pt (point))))
 
 (defun avy-action-teleport (pt)
   "Kill sexp starting on PT and yank into the current location."



reply via email to

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