kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

which-key breaks `vim.v.count` in visual mode

Open nathanzeng opened this issue 6 months ago • 6 comments

This bug has been reported in which-key here, but that was 2 years ago so it seems unlikely that it will be fixed. Making an issue here for discussion.

Reproduction

  1. Go to this line (currently 901 on master), and put your cursor on the first '. I marked cursor pos with | | local parsers = { |'|bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
  2. Type v]n2]n Confirm that 'diff' is selected when in reality 'html' should be selected
  3. To confirm that which-key is the issue, remove the installation lines for only which-key, and do the above steps again

Discussion While certainly an edge case, this is indeed a bug. #2046 stops which-key from triggering in visual mode to fix this, but I don't think it's a good solution. Open to discussion for better solutions.

nathanzeng avatar May 12 '26 06:05 nathanzeng

I seem to be able to reproduce it. I wonder how I never noticed that 😕

It's unfortunate that the only fix right now is the disable it in visual mode. I remember it which-key being very useful for me when I started out, even in visual mode.

I wonder which is worse for beginners. I will need to think about it for a bit. In the meantime, does anyone else have a preference either way?

oriori1703 avatar Jun 11 '26 14:06 oriori1703

IMO which-key is much more useful than the severity of this edge case issue, I would keep which-key.

dam9000 avatar Jun 11 '26 20:06 dam9000

I don't think we should remove which-key. I was more asking whether we should disable in visual mode, leave a comment about this edge case, or do nothing at all.

nathanzeng avatar Jun 11 '26 22:06 nathanzeng

I don't think we should remove which-key. I was more asking whether we should disable in visual mode, leave a comment about this edge case, or do nothing at all.

I think @dam9000 was not talking about removing which-key entirely. He was talking about it removing it for visual mode vs the bug.

oriori1703 avatar Jun 13 '26 20:06 oriori1703

Anyone played with switching to mini.clue? Considering playing with it soon.

mattcargile avatar Jul 13 '26 00:07 mattcargile

When I was debugging with require 'osf', I can't reproduce the behavior funnily enough. I am a bit of a novice though.

mattcargile avatar Jul 17 '26 22:07 mattcargile