liuchengxu / vim-which-key

:tulip: Vim plugin that shows keybindings in popup
https://liuchengxu.github.io/vim-which-key/
MIT License
1.93k stars 65 forks source link

Improve keycode merging #221

Closed rene-descartes2021 closed 2 years ago

rene-descartes2021 commented 2 years ago

Rather than list specific cases <Tab> <Space>, I think it better to generalize.

This PR proposes a way to generalize the mapping of keycodes to internal data-structures (description dictionary, native cache).

Also a couple other improvements:

  1. Improved regex escaping in s:has_children()
  2. Improved loop in s:wait_with_timeout(), there was a 20ms window before the timeout where if the user pressed a key in that timespan it would be considered not pressed.
liuchengxu commented 2 years ago

Sorry for the late merge, great work! :beers: