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

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

[nongnu] elpa/evil 48c9286a5b: Save excursion when adding preceeding whi


From: ELPA Syncer
Subject: [nongnu] elpa/evil 48c9286a5b: Save excursion when adding preceeding whitespace to A word
Date: Sun, 7 Aug 2022 11:58:27 -0400 (EDT)

branch: elpa/evil
commit 48c9286a5b1f0e74c8260b29cbc8025681e15094
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>

    Save excursion when adding preceeding whitespace to A word
    
    Fixes #1644
---
 evil-common.el | 2 +-
 evil-tests.el  | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/evil-common.el b/evil-common.el
index e6f2ec954e..7f0bad4e7d 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -3210,7 +3210,7 @@ linewise, otherwise it is character wise."
                       ;; restrict to current line if we do non-line selection
                       (and (not line)
                            (if (member thing '(evil-word evil-WORD))
-                               (progn (back-to-indentation) (point))
+                               (save-excursion (back-to-indentation) (point))
                              (line-beginning-position)))
                       (and (not line) (line-end-position))
                     (evil-bounds-of-not-thing-at-point thing (- dir))))
diff --git a/evil-tests.el b/evil-tests.el
index 2136a5a64e..d50665eb7e 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -6000,7 +6000,12 @@ Line 2"))
     (evil-test-buffer
       "   [b]ar"
       ("daW")
-      "  [ ]")))
+      "  [ ]")
+    (ert-info ("But deleting the final word of many behaves as normal")
+      (evil-test-buffer
+        "   foo   [b]ar"
+        ("daw")
+        "   fo[o]"))))
 
 (ert-deftest evil-test-word-objects-cjk ()
   "Test `evil-inner-word' and `evil-a-word' on CJK words"



reply via email to

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