From: Christian Heller Date: Wed, 23 Oct 2019 22:21:59 +0000 (+0200) Subject: Fix paste-forward behavior at end of buffer. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%27%29;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chunks.push%28escapeHTML%28span%5B2%5D%29%29;%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chunks.push%28%27?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=plomvi.el Fix paste-forward behavior at end of buffer. --- diff --git a/plomvi.el b/plomvi.el index 28ede50..bda484d 100644 --- a/plomvi.el +++ b/plomvi.el @@ -128,14 +128,18 @@ Note that this ignores killed rectangles. (defun plomvi-paste-forward () "Paste last kill rightwards in current line, or (if kill ends in \n) under it. +Doesn't move rightwards before yanking if at end of buffer. + Note that this ignores killed rectangles." (interactive) (if (eq nil (string-match "\n$" (current-kill 0))) (progn - (right-char) + (if (< (point) (point-max)) + (right-char)) (yank)) (end-of-line) - (right-char) + (if (< (point) (point-max)) + (right-char)) (yank) (previous-line)))