folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.31k stars 170 forks source link

`quote0` register not being populated #202

Closed aleprovencio closed 2 years ago

aleprovencio commented 2 years ago

AKA yank register, the register that records the most recent yank command, is not working with which-key default options.

The issue is on the operator preset, and I'm disabling it as a temporary fix, as in:

require'which-key'.setup {plugins = {presets = {operators = false}}}

I've seen #36, maybe there's something related.

cpakkala commented 2 years ago

I have the same issue with register zero not being populated, but even disabling the operator presets doesn't fix it.

JoshNavi commented 2 years ago

Did some digging on this locally and it seems like the issue is that when set clipboard=unnamed or set clipboard=unnamedplus is active M.reg evaluates to * or + respectively here: https://github.com/folke/which-key.nvim/blob/312c386ee0eafc925c27869d2be9c11ebdb807eb/lua/which-key/view.lua#L232-L241

I also noticed that without the clipboard setting (or set clipboard=) M.reg will evaluate to ". I found that resetting the variable back to " resolved the issue of the quote0 register not being set without affecting the system clipboard integration.

I just opened a PR which implements a potential fix, please let me know what you think: https://github.com/folke/which-key.nvim/pull/233

aleprovencio commented 2 years ago

LGTM @JoshNavi, way to go! :smile:

bdwiel commented 2 years ago

I'm seeing this issue too. Anything preventing the fix from being merged?

karangb commented 2 years ago

+1 ; facing this issue too; @folke , can we merge this fix pls?

MJB47 commented 2 years ago

any update on this?

desilinguist commented 2 years ago

I ran into the same issue when using whichkey with osc52. It'd be great if this fix can be merged. I applied it in my fork for now. Thanks for a great plugin!