gbprod / yanky.nvim

Improved Yank and Put functionalities for Neovim
Do What The F*ck You Want To Public License
802 stars 22 forks source link

Issue running macros with "norm" #180

Closed pejrich closed 1 month ago

pejrich commented 1 month ago

I'm having an issue with macros, but only for some reason when they're run with norm.

*|*one
two
three

Here's the setup. qq yiwp q

It should now have

oonene
*|*two
three

Run :norm @q, go down to three and run :norm @q again. Now you'll have

oonene
tonewo
ttwohree

It's like anytime I run a macro with norm, for some reason my yank history is one level out of whack.

This is a bit different but I think related.

*|*1

the macro is yyp1<C-a>. If I run it one at a time everything works. But, If I run it with norm 5@q I get:

1
2
2
2
2
2

Any idea how I could fix this? If I disable Yanky, everything works again. I've tried adjusting all the options, but typically I just have the default opts.

gbprod commented 1 month ago

Interesting issue, I have to do some tests...

pejrich commented 1 month ago

@gbprod Hold on, you can ignore this 😅. I checked every setting of the plugin, and I tested it in my nvim setup, and a plain nvim setup to double check the issue wasn't something on my side...of course I didn't remember that I have a system clipboard manager. Turns out that the clipboard manager polls the system clipboard every 100ms, so it seems that if you yank and paste rapidly you're yanking to the system, but pasting from the clipboard manager.

I'm not sure a way around this, but it's not anything related to the plugin. The only work around I can think of is yanking/pasting from a vim only register during macros, so I'll have to look at that.

Sorry for posting this before I had thoroughly tested it.