aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/keycodes.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-07 17:49:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-03-08 05:45:39 +0800
commit12d4caa9d3e4224b7c2922f112955100649d6069 (patch)
tree5a0e5a22c30d7c003114bd66489b8f75c62125e4 /src/nvim/keycodes.lua
parentaf42f79221af793adeb8c2552463a87ddde08a7e (diff)
downloadrneovim-12d4caa9d3e4224b7c2922f112955100649d6069.tar.gz
rneovim-12d4caa9d3e4224b7c2922f112955100649d6069.tar.bz2
rneovim-12d4caa9d3e4224b7c2922f112955100649d6069.zip
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.
Diffstat (limited to 'src/nvim/keycodes.lua')
-rw-r--r--src/nvim/keycodes.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/keycodes.lua b/src/nvim/keycodes.lua
index c6158b0b84..04f09eb005 100644
--- a/src/nvim/keycodes.lua
+++ b/src/nvim/keycodes.lua
@@ -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' },