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.12k stars 163 forks source link

fix(state): improve detection of mode changing #789

Closed mehalter closed 1 month ago

mehalter commented 1 month ago

Description

This helps improve the detection of mode changes in Neovim. It makes 2 small changes.

Related Issue(s)

folke commented 1 month ago

This will unfortunately break plugins that rely on canceling the existing operator (like flash and others). I've been looking into it myself as well and what I see is that after the mode change "t:n", the mode is n for a couple of ms, and then changes for about 50ms to t again after which it again becomes n.

I think this is probably due to some external process that gets started with something like <cmd> which wouldn't trigger ModeChange events, but which would still change the actual mode.

Need to look into a proper way of dealing with this.