Thomas Michael Engelke wrote:
Hello,

I have found an oddity in vim which I'm not sure is a bug and/or known.

I have yanked a visual block of some lines of code and try to put it
in somewhere else. There a strange effect happens: depending on if
there is either a character or a beginning of line left besides the
cursor, paste via "p" works different.

When I have a BOL or a char to the left, it gets pasted and uses the
cursor position as upper left corner. When there's no char/BOL, it
uses the char right beside the cursor position as upper left corner.

It's easily reproducable by just moving the cursor one position to the
right and paste the block again.

Anybody that can reproduce the problem and/or shed some light on it?

Note: Shift+P works as a workaround.

Regards,

Thomas


I don't understand what you mean.

p means "put after cursor"; P (shift-p) is "put before". Depending on whether the selection to be pasted is characterwise, linewise or blockwise, the result will be different. Now let's assume it's blockwise, and that 'virtualedit' is off (e.g. empty). Using p inserts the selection after the cursor character, and after the character in the same column on successive lines. If some of the lines are shorter, spaces are inserted so that the block will be inserted as a rectangle. The exception is when the cursor is on an empty line: in that case there is no character at the cursor, and the block gets pasted "after character zero", i.e., at the start of the current line and of successive lines after that. I don't see any problem. What is it that you don't understand?


Best regards,
Tony.

Reply via email to