Yankstack's mappings (line 170) rely on Vim's v:register variable to define the currently active register. However, there's one oddity about the v:register: after yanking/deleting something its value doesn't update until the cursor is moved or some other action is performed (try doing "_x:echo v:register, apparently it's intended). That means that if you delete something into the blackhole register for instance, and then immediately use Yankstack to paste without specifying a register, the paste_with_key function receives the previously used _ in the parameter a:register instead of " which is what the user would expect. In other words, Yankstack will try to paste from the blackhole register instead of the default register with p if the previous command used the blackhole reg.
The commit simply transforms the blackhole register into default register when pasting. This fixes pasting with plain p so you can do "_xP for instance. Pastes using an explicit register are unaffected, apart from the blackhole register which I don't think anybody has any reason to paste from.
I haven't tested the commit with the suite since I'm unfamiliar with Ruby and kind of preoccupied. It's been working for me for a while though and it seems like a harmless change.
Yankstack's mappings (line 170) rely on Vim's
v:register
variable to define the currently active register. However, there's one oddity about thev:register
: after yanking/deleting something its value doesn't update until the cursor is moved or some other action is performed (try doing"_x:echo v:register
, apparently it's intended). That means that if you delete something into the blackhole register for instance, and then immediately use Yankstack to paste without specifying a register, thepaste_with_key
function receives the previously used_
in the parametera:register
instead of"
which is what the user would expect. In other words, Yankstack will try to paste from the blackhole register instead of the default register withp
if the previous command used the blackhole reg.The commit simply transforms the blackhole register into default register when pasting. This fixes pasting with plain
p
so you can do"_xP
for instance. Pastes using an explicit register are unaffected, apart from the blackhole register which I don't think anybody has any reason to paste from.I haven't tested the commit with the suite since I'm unfamiliar with Ruby and kind of preoccupied. It's been working for me for a while though and it seems like a harmless change.