aboutsummaryrefslogtreecommitdiff
path: root/evil-states.el
diff options
context:
space:
mode:
authorTom Dalziel <tom_dl@hotmail.com>2024-06-04 09:38:55 +0200
committerTom Dalziel <33435574+tomdl89@users.noreply.github.com>2024-06-14 18:21:16 +0200
commitf29ad3c91e06ca1910f326b3b0a41ae59ba2c8b6 (patch)
tree5117d95ad9f59d3461a7f303aee59e61228eb9f7 /evil-states.el
parenta32f016536fadf5080be39f239288b76146216ee (diff)
Track (and restore) previous visual selection, point, mark for gv
Diffstat (limited to 'evil-states.el')
-rw-r--r--evil-states.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/evil-states.el b/evil-states.el
index 6b86d9d..26eb844 100644
--- a/evil-states.el
+++ b/evil-states.el
@@ -421,7 +421,10 @@ If LATER is non-nil, exit after the current command."
(setq deactivate-mark t)
(when evil-visual-region-expanded
(evil-visual-contract-region))
- (setq evil-this-register nil)
+ (setq evil-this-register nil
+ evil-prev-visual-selection evil-visual-selection
+ evil-prev-visual-mark (copy-marker evil-visual-mark)
+ evil-prev-visual-point (copy-marker evil-visual-point))
(evil-change-to-previous-state)))))
(defun evil-visual-tag (&optional selection)
@@ -777,7 +780,8 @@ Default to `evil-visual-make-region'."
"Return a Visual selection for TYPE."
(catch 'done
(dolist (selection evil-visual-alist)
- (when (eq (symbol-value (cdr selection)) type)
+ (when (memq (symbol-value (cdr selection))
+ (list type (evil-visual-type type)))
(throw 'done (car selection))))))
(defun evil-visual-block-corner (&optional corner point mark)