aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorBarrett Ruth <br@barrettruth.com>2026-07-25 10:26:01 -0700
committerBarrett Ruth <br@barrettruth.com>2026-07-25 10:36:56 -0700
commit22d44ef8754448294833fcbc197defaca355f3b5 (patch)
treec87aa5aa31b471dad36ffb2873f8dfcf308afc91 /test/functional/lua/vim_spec.lua
parent1facf1e0818a15588deea4809292cd32cf362bed (diff)
downloadrneovim-22d44ef8754448294833fcbc197defaca355f3b5.tar.gz
rneovim-22d44ef8754448294833fcbc197defaca355f3b5.tar.bz2
rneovim-22d44ef8754448294833fcbc197defaca355f3b5.zip
fix(api): add `lhs` option for keymap deletion
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 844bef111f..03ceb6345f 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -3049,6 +3049,23 @@ describe('vim.keymap', function()
eq('\nNo mapping found', n.exec_capture('nmap qwer'))
end)
+ it('unmap with lhs option', function()
+ eq(
+ 'q',
+ exec_lua [[
+ vim.keymap.set('n', 'ge', 'q')
+ local ok, err = pcall(vim.keymap.del, 'n', 'q', { lhs = true })
+ assert(not ok and err:match('E31: No such mapping'), err)
+ return vim.fn.maparg('ge', 'n')
+ ]]
+ )
+
+ exec_lua [[
+ vim.keymap.del('n', 'ge', { lhs = true })
+ ]]
+ eq('\nNo mapping found', n.exec_capture('nmap ge'))
+ end)
+
it('buffer-local mappings', function()
eq(
0,