Describe the bug
Using gp
to put the text of a register might move the cursor to an unexpected position when these conditions are met:
gp
.To Reproduce
Run vim -Nu NONE
.
:source
this script:
call setreg('@', "foo\nbar", 'c') new let lines =<< trim END <----> END call setline(1, lines) normal! 1G2f- normal! 3gp
The new window consists of these lines:
<--foo
barfoo
barfoo
bar-->
This is expected.
But the cursor is on the f
of line 2, which is not expected.
Expected behavior
The cursor is on the first -
of line 4. Because the help says gp
leaves the cursor just after the new text:
*gp*
["x]gp Just like "p", but leave the cursor just after the new
text.
Environment
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
It seems the position of ']
mark is also wrong; it is placed on the r
of line 2 (i.e. just before the cursor) in the example above. I would think it should be on the r
of line 4.
Thank you!