aboutsummaryrefslogtreecommitdiff
path: root/evil-states.el
diff options
context:
space:
mode:
authorTom Dalziel <tom_dl@hotmail.com>2021-12-12 23:12:04 +0000
committerTom Dalziel <33435574+tomdl89@users.noreply.github.com>2021-12-19 18:29:22 +0100
commitdd13874ff759ece05cbe47d10549c25ee86bff2f (patch)
tree952ab3069136af61fb36ddd9c19a921e1df70c52 /evil-states.el
parenta1f623c3eb12ecf42ad4b1665a7fde7e30451320 (diff)
Replace state pasting
Diffstat (limited to 'evil-states.el')
-rw-r--r--evil-states.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/evil-states.el b/evil-states.el
index d9784b5..0e3b9e9 100644
--- a/evil-states.el
+++ b/evil-states.el
@@ -905,15 +905,16 @@ CORNER defaults to `upper-left'."
(when char
(insert char))))))
-(defun evil-update-replace-alist (opoint count chars-to-delete)
+(defun evil-update-replace-alist (opoint count chars-to-delete &optional offset)
"Add CHARS-TO-DELETE chars to evil-replace-alist, starting at OPOINT.
-If COUNT is greater than CHARS-TO-DELETE, pad the alist with nils."
+If COUNT is greater than CHARS-TO-DELETE, pad the alist with nils.
+Decrement recorded position by optional offset, or 0."
(when (evil-replace-state-p)
(dotimes (c count)
(let ((pos (+ c opoint)))
(add-to-list 'evil-replace-alist
- (cons pos (when (< c chars-to-delete)
- (char-after pos))))))))
+ (cons (- pos (or offset 0)) (when (< c chars-to-delete)
+ (char-after pos))))))))
;;; Motion state