mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
fix(nvim_create_user_command): make smods
work with nvim_cmd
Closes #18876.
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user