Skip to content

Commit a4ba0ac

Browse files
committed
Move cursor back before the pasted text in evil-paste-before and evil-paste-after
1 parent 297b8f3 commit a4ba0ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

evil-commands.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,9 @@ The return value is the yanked text."
18931893
(evil-set-marker ?\] (1- (point)))
18941894
(when (and evil-move-cursor-back
18951895
(> (length text) 0))
1896-
(backward-char))))
1896+
(backward-char))
1897+
(if (evil-normal-state-p)
1898+
(evil-exchange-point-and-mark))))
18971899
;; no paste-pop after pasting from a register
18981900
(when register
18991901
(setq evil-last-paste nil))
@@ -1944,7 +1946,8 @@ The return value is the yanked text."
19441946
(evil-set-marker ?\[ beg)
19451947
(evil-set-marker ?\] (1- (point)))
19461948
(when (evil-normal-state-p)
1947-
(evil-move-cursor-back)))))
1949+
(evil-move-cursor-back)
1950+
(evil-exchange-point-and-mark)))))
19481951
(when register
19491952
(setq evil-last-paste nil))
19501953
(and (> (length text) 0) text)))))

0 commit comments

Comments
 (0)