keymap.lua: Fix duplicate keymap detection (#1379)
'listen' has some code in it to try to not re-set a map for an existing mapping, by checking the 'desc' of the table returned from 'get_map'. Since 'desc' was never included in the table returned from 'get_map', I'm assuming my changes here were always the intention. This change seems to fix an issue I was seeing (with cmp-nvim-ultisnips at least) where every time I'd enter and leave Insert mode, seemingly another <Tab> handler was getting registered, overtime causing <Tab> in Insert mode to get slower and slower.
This commit is contained in:
@@ -208,6 +208,7 @@ keymap.get_map = function(mode, lhs)
|
||||
rhs = map.rhs or '',
|
||||
expr = map.expr == 1,
|
||||
callback = map.callback,
|
||||
desc = map.desc,
|
||||
noremap = map.noremap == 1,
|
||||
script = map.script == 1,
|
||||
silent = map.silent == 1,
|
||||
@@ -225,6 +226,7 @@ keymap.get_map = function(mode, lhs)
|
||||
rhs = map.rhs or '',
|
||||
expr = map.expr == 1,
|
||||
callback = map.callback,
|
||||
desc = map.desc,
|
||||
noremap = map.noremap == 1,
|
||||
script = map.script == 1,
|
||||
silent = map.silent == 1,
|
||||
|
||||
Reference in New Issue
Block a user