perf(keycodes): use hashy for string lookup

This is slightly faster than the binary search as per the benchmark, and
allows handling the vim/vim#16821 situation in generator code.
This commit is contained in:
zeertzjq
2025-03-07 17:49:54 +08:00
parent af42f79221
commit 12d4caa9d3
4 changed files with 85 additions and 88 deletions

View File

@@ -1,5 +1,7 @@
return {
--- @type [string, string][] List of [key, name] tuples.
--- For keys with multiple names, put the preferred name first.
--- For multiple keys with the same name, put the preferred key first.
names = {
{ [[' ']], 'Space' },
{ [[TAB]], 'Tab' },