diff options
| author | Tom Dalziel <tom_dl@hotmail.com> | 2022-04-18 10:59:34 +0100 |
|---|---|---|
| committer | Tom Dalziel <33435574+tomdl89@users.noreply.github.com> | 2022-04-18 12:24:56 +0200 |
| commit | b77bf5ef3ba3b716061c900df46503a78212a431 (patch) | |
| tree | ccfe06cd9214bbc8e7a79f30bf839902bf618dcf | |
| parent | 197e5c111efdcc5a86f1f02749acd695991192e0 (diff) | |
Visual point+mark dependent on initial visual paste direction
| -rw-r--r-- | evil-commands.el | 5 |
1 files 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) |
