junegunn / vim-peekaboo

:eyes: " / @ / CTRL-R
1.13k stars 39 forks source link

Strange behaviour with register in macro, normal mode #12

Closed nicolaiskogheim closed 9 years ago

nicolaiskogheim commented 9 years ago

This is a nasty one. And I'm not even sure of what is going on.

What

Special sequence of commands, involving moving a line up/down, pasting from a specified register, and moving back, produces strange output.

My setup

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 9 2014 22:01:23) MacOS X (unix) version Included patches: 1-488 Compiled by Homebrew The settings in my vimrc (mappings and functions removed) Tested without other plugins. Cannot reproduce with peekaboo plugin disabled.

Macros that trigger the bug

These produce the exact same output when peekaboo is enabled. Should paste a word under the cursor

Expected:

some text that was here before
YES

Actual:

sYESome text that was here before
(empty line inserted from the  o-command, if you used the macro with an o-command)

Notes: The bug does occur for other registers than the one used in the example. The bug does not occur if you paste without specifying register with ". The bug does not occur if you don't move back to the starting line. So this macro does not trigger it: k""p (the same as the last macro in the list of macros, but without the j for returning to the line).

junegunn commented 9 years ago

Thanks for the details report! #13 seems to fix this as well. Let me know if you still see the problem after the update.