aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Dalziel <tom_dl@hotmail.com>2022-04-18 10:59:05 +0100
committerTom Dalziel <33435574+tomdl89@users.noreply.github.com>2022-04-18 12:24:56 +0200
commit197e5c111efdcc5a86f1f02749acd695991192e0 (patch)
treec6efc63a229e03ecf91f86fdb341ee31aef1eacc
parent214fd3bcd75bf5923654146e992bfe3576c7d3ee (diff)
Update markers when blockwise visual pasting
-rw-r--r--evil-commands.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 60285a6..aebb40a 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -2213,10 +2213,12 @@ The return value is the yanked text."
(setq evil-last-paste nil))
(and (> (length text) 0) text)))))
-(defun evil-insert-for-yank-at-col (startcol _endcol string)
+(defun evil-insert-for-yank-at-col (startcol _endcol string count)
"Insert STRING at STARTCOL."
(move-to-column startcol)
- (insert-for-yank string))
+ (dotimes (_ (or count 1))
+ (insert-for-yank string))
+ (evil-set-marker ?\] (1- (point))))
(evil-define-command evil-visual-paste (count &optional register)
"Paste over Visual selection."
@@ -2260,7 +2262,8 @@ The return value is the yanked text."
((eq 'block (evil-visual-type))
(when (eq yank-handler #'evil-yank-line-handler)
(setq text (concat "\n" text)))
- (evil-apply-on-block #'evil-insert-for-yank-at-col beg end t text))
+ (evil-set-marker ?\[ beg)
+ (evil-apply-on-block #'evil-insert-for-yank-at-col beg end t text count))
(paste-eob (evil-paste-after count register))
(t (evil-paste-before count register)))))
(when evil-kill-on-visual-paste