The problem happens when the count on normal p is greater than the number of lines on the buffer.
1 - open a new buffer and type aabc<esc>
2 - yy2p
Instead of pasting "abc" the 2p command fails complaining about "invalid range".
It seems that for some reason the count is used as a range to all <SNR>3_paste_with_key("p", "n", ....
One solution may be include<C-u> (:<C-u>call <SNR>3_paste_with_key("p", "n", ...), similar to :vmap p.
But it seems that adding <C-u> alone removes the count, so 2p perform a single paste.
The problem happens when the count on normal
p
is greater than the number of lines on the buffer.1 - open a new buffer and type
aabc<esc>
2 - yy2pInstead of pasting "abc" the
2p
command fails complaining about "invalid range". It seems that for some reason the count is used as a range to all<SNR>3_paste_with_key("p", "n", ...
. One solution may be include<C-u>
(:<C-u>call <SNR>3_paste_with_key("p", "n", ...
), similar to:vmap p
. But it seems that adding<C-u>
alone removes the count, so2p
perform a single paste.