File tree 1 file changed +19
-8
lines changed
1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -435,19 +435,30 @@ local create_window = function(state)
435
435
win :unmount ()
436
436
end , { once = true })
437
437
438
+ local skip_this_mapping = {
439
+ [" none" ] = true ,
440
+ [" nop" ] = true ,
441
+ [" noop" ] = true ,
442
+ [" " ] = true ,
443
+ [{}] = true ,
444
+ }
438
445
local map_options = { noremap = true , nowait = true }
439
446
local mappings = utils .get_value (state , " window.mappings" , {}, true )
440
447
for cmd , func in pairs (mappings ) do
441
448
if func then
442
- if type (func ) == " string" then
443
- func = state .commands [func ]
444
- end
445
- if type (func ) == " function" then
446
- win :map (" n" , cmd , function ()
447
- func (state )
448
- end , map_options )
449
+ if skip_this_mapping [func ] then
450
+ log .trace (" Skipping mapping for %s" , cmd )
449
451
else
450
- log .warn (" Invalid mapping for %s: %s" , cmd , func )
452
+ if type (func ) == " string" then
453
+ func = state .commands [func ]
454
+ end
455
+ if type (func ) == " function" then
456
+ win :map (" n" , cmd , function ()
457
+ func (state )
458
+ end , map_options )
459
+ else
460
+ log .warn (" Invalid mapping for " , cmd , " : " , func )
461
+ end
451
462
end
452
463
end
453
464
end
You can’t perform that action at this time.
0 commit comments