mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix: check for valid buffer handles in modify_keymap (#13543)
Fixes #13541 Neovim would crash when trying to map a key on non existant buffer
This commit is contained in:
@@ -809,4 +809,9 @@ describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function()
|
||||
command('normal lhs')
|
||||
eq({'rhs'}, bufmeths.get_lines(0, 0, 1, 1))
|
||||
end)
|
||||
|
||||
it("does not crash when setting keymap in a non-existing buffer #13541", function()
|
||||
pcall_err(bufmeths.set_keymap, 100, '', 'lsh', 'irhs<Esc>', {})
|
||||
helpers.assert_alive()
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user