mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
fix(mappings): fix mapset() not replacing map with backslash (#26719)
This commit is contained in:
@@ -180,6 +180,16 @@ end)
|
||||
describe('mapset()', function()
|
||||
before_each(clear)
|
||||
|
||||
it('can restore mapping with backslash in lhs', function()
|
||||
meths.set_keymap('n', '\\ab', 'a', {})
|
||||
eq('\nn \\ab a', exec_capture("nmap \\ab"))
|
||||
local mapargs = funcs.maparg('\\ab', 'n', false, true)
|
||||
meths.set_keymap('n', '\\ab', 'b', {})
|
||||
eq('\nn \\ab b', exec_capture("nmap \\ab"))
|
||||
funcs.mapset('n', false, mapargs)
|
||||
eq('\nn \\ab a', exec_capture("nmap \\ab"))
|
||||
end)
|
||||
|
||||
it('can restore mapping description from the dict returned by maparg()', function()
|
||||
meths.set_keymap('n', 'lhs', 'rhs', {desc = 'map description'})
|
||||
eq('\nn lhs rhs\n map description', exec_capture("nmap lhs"))
|
||||
|
Reference in New Issue
Block a user