Closed Coacher closed 7 years ago
Example file:
123
456
789
Steps to reproduce the problem:
VGygvp
Actual results (notice extra blank line at the beginning):
123
456
789
Expected results:
123
456
789
It turns out linewise Visual pasting has this unique feature when pasting to an empty buffer: it preserves the empty line that is already in the buffer. This leads to problems when pasting over the whole buffer in linewise Visual mode because "_d
is called before actual pasting, which leaves us with an empty buffer. Workaround it by reselecting this single empty line. This is also how default Vim behaves (it doesn't produce any extra blank lines).
Characterwise and blockwise modes are unaffected.
Again similar problem affects XG_EasyClipPaste, but there's no such simple fix for that.
Thanks for this. Sorry it took me so long to merge!
A bit of mish-mash with PR #89. I can reduce this to a single commit later rather than fix conflicts.