diff options
author | Famiu Haque <famiuhaque@protonmail.com> | 2022-06-08 09:06:36 +0600 |
---|---|---|
committer | Famiu Haque <famiuhaque@protonmail.com> | 2022-06-08 15:24:52 +0600 |
commit | c84bd9e21fb1e5c55c9c5370b07271a6ae96f19c (patch) | |
tree | 102caf20be85af78aad8cc4695ae1e7abcf3baf3 /test | |
parent | 3cd22a34852b7453eecb4715806cc09dcc226e0c (diff) | |
download | rneovim-c84bd9e21fb1e5c55c9c5370b07271a6ae96f19c.tar.gz rneovim-c84bd9e21fb1e5c55c9c5370b07271a6ae96f19c.tar.bz2 rneovim-c84bd9e21fb1e5c55c9c5370b07271a6ae96f19c.zip |
fix(nvim_create_user_command): make `smods` work with `nvim_cmd`
Closes #18876.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/command_spec.lua | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/test/functional/api/command_spec.lua b/test/functional/api/command_spec.lua index 253371557a..a9ec2b6541 100644 --- a/test/functional/api/command_spec.lua +++ b/test/functional/api/command_spec.lua @@ -136,7 +136,7 @@ describe('nvim_create_user_command', function() silent = false, split = "", tab = 0, - verbose = 0, + verbose = -1, vertical = false, }, range = 0, @@ -170,7 +170,7 @@ describe('nvim_create_user_command', function() silent = false, split = "", tab = 0, - verbose = 0, + verbose = -1, vertical = false, }, range = 0, @@ -204,7 +204,7 @@ describe('nvim_create_user_command', function() silent = false, split = "", tab = 0, - verbose = 0, + verbose = -1, vertical = false, }, range = 0, @@ -238,7 +238,7 @@ describe('nvim_create_user_command', function() silent = false, split = "botright", tab = 0, - verbose = 0, + verbose = -1, vertical = false, }, range = 1, @@ -272,7 +272,7 @@ describe('nvim_create_user_command', function() silent = false, split = "", tab = 0, - verbose = 0, + verbose = -1, vertical = false, }, range = 1, @@ -306,7 +306,7 @@ describe('nvim_create_user_command', function() silent = false, split = "", tab = 0, - verbose = 0, + verbose = -1, vertical = false, }, range = 0, @@ -352,7 +352,7 @@ describe('nvim_create_user_command', function() silent = false, split = "", tab = 0, - verbose = 0, + verbose = -1, vertical = false, }, range = 0, @@ -418,6 +418,16 @@ describe('nvim_create_user_command', function() vim.api.nvim_create_user_command('💩', 'echo "hi"', {}) ]])) end) + + it('smods can be used with nvim_cmd', function() + exec_lua[[ + vim.api.nvim_create_user_command('MyEcho', function(opts) + vim.api.nvim_cmd({ cmd = 'echo', args = { '&verbose' }, mods = opts.smods }, {}) + end, {}) + ]] + + eq("3", meths.cmd({ cmd = 'MyEcho', mods = { verbose = 3 } }, { output = true })) + end) end) describe('nvim_del_user_command', function() |