which-key.nvim icon indicating copy to clipboard operation
which-key.nvim copied to clipboard

Pressing gg in normal mode results in "Press ENTER or type command to continue" when cmdheight=0

Open registerGen opened this issue 2 years ago • 9 comments

registerGen avatar Jun 28 '22 06:06 registerGen

Can confirm. Happens also for gt and gT. Also seems to cause problems where gi and gf won't work properly (in the case of gi, there won't be a press enter prompt, it just won't work properly)

Note: setting the g preset to false does not help

jemag avatar Jul 01 '22 03:07 jemag

There's a (maybe unrelated? I'm not sure) discussion in neovim's repo now. neovim/neovim#19184 neovim/neovim#19185

registerGen avatar Jul 01 '22 12:07 registerGen

@xiyaowong OK. I have reproduced.

It seems which-key.nvim implementation problem because of https://github.com/folke/which-key.nvim/blob/535703cd4f08623e12458b5522be1f4ec2a878e7/lua/which-key/view.lua#L123

wchich-key.nvim has dummy output. It is not needed for cmdheight=0.

Shougo avatar Jul 03 '22 00:07 Shougo

If I comment out the line, the problem is gone.

Shougo avatar Jul 03 '22 01:07 Shougo

@Shougo got it

xiyaowong avatar Jul 03 '22 01:07 xiyaowong

Got it. Thank you!

registerGen avatar Jul 03 '22 03:07 registerGen

This also affect gq

bennypowers avatar Jul 05 '22 09:07 bennypowers

As a workaround for now, the bindings for g can be disabled by setting the triggers option:

require("which-key").setup({
  triggers = { "<leader>" }
})

rstacruz avatar Jul 05 '22 15:07 rstacruz

another workaround is to patch wk at runtime

bennypowers avatar Jul 05 '22 15:07 bennypowers

OK, I'll close it now.

registerGen avatar Sep 03 '22 12:09 registerGen