From b77bf5ef3ba3b716061c900df46503a78212a431 Mon Sep 17 00:00:00 2001 From: Tom Dalziel Date: Mon, 18 Apr 2022 10:59:34 +0100 Subject: Visual point+mark dependent on initial visual paste direction --- evil-commands.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/evil-commands.el b/evil-commands.el index aebb40a..8a54de7 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -2234,6 +2234,7 @@ The return value is the yanked text." (current-kill 0))) (yank-handler (car-safe (get-text-property 0 'yank-handler text))) + (dir (evil-visual-direction)) beg end paste-eob) (evil-with-undo (let ((kill-ring-yank-pointer (when kill-ring (list (current-kill 0))))) @@ -2270,9 +2271,9 @@ The return value is the yanked text." (current-kill -1)) ;; Ensure that gv can restore visually pasted area... (setq evil-visual-previous-mark evil-visual-mark - evil-visual-mark (evil-get-marker ?\[ t) + evil-visual-mark (evil-get-marker (if (<= 0 dir) ?\[ ?\]) t) evil-visual-previous-point evil-visual-point - evil-visual-point (evil-get-marker ?\] t)) + evil-visual-point (evil-get-marker (if (<= 0 dir) ?\] ?\[) t)) ;; mark the last paste as visual-paste (setq evil-last-paste (list (nth 0 evil-last-paste) -- cgit v1.0