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

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

[nongnu] elpa/evil 94fda4cc64 1/3: Simplify evil-visual-restore


From: ELPA Syncer
Subject: [nongnu] elpa/evil 94fda4cc64 1/3: Simplify evil-visual-restore
Date: Fri, 7 Jan 2022 07:58:06 -0500 (EST)

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

    Simplify evil-visual-restore
---
 evil-commands.el | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/evil-commands.el b/evil-commands.el
index f75f685388..4611666039 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -2402,27 +2402,14 @@ when called interactively."
   "Restore previous selection."
   (let* ((point (point))
          (mark (or (mark t) point))
-         (dir evil-visual-direction)
-         (type (evil-visual-type))
-         range)
+         (type (evil-visual-type)))
+    ;; TODO handle swapping selection in visual state...
     (unless (evil-visual-state-p)
       (cond
        ;; No previous selection.
        ((or (null evil-visual-selection)
             (null evil-visual-mark)
             (null evil-visual-point)))
-       ;; If the type was one-to-one, it is preferable to infer
-       ;; point and mark from the selection's boundaries. The reason
-       ;; is that a destructive operation may displace the markers
-       ;; inside the selection.
-       ((evil-type-property type :one-to-one)
-        (setq range (evil-contract-range (evil-visual-range))
-              mark (evil-range-beginning range)
-              point (evil-range-end range))
-        (when (< dir 0)
-          (evil-swap mark point)))
-       ;; If the type wasn't one-to-one, we have to restore the
-       ;; selection on the basis of the previous point and mark.
        (t
         (setq mark evil-visual-mark
               point evil-visual-point)))



reply via email to

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