mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
fix(lua): fix architecture-dependent behavior in usercmd "reg" (#20384)
I don't think using an integer as a NUL-terminated string can work on big-endian systems, at least. This is also not tested. Add a test. Also fix a mistake in the docs of nvim_parse_cmd.
This commit is contained in:
@@ -423,6 +423,7 @@ describe('nvim_create_user_command', function()
|
||||
nargs = 0,
|
||||
bang = true,
|
||||
count = 2,
|
||||
register = true,
|
||||
})
|
||||
]]
|
||||
eq({
|
||||
@@ -460,6 +461,42 @@ describe('nvim_create_user_command', function()
|
||||
vim.cmd('CommandWithNoArgs')
|
||||
return result
|
||||
]])
|
||||
-- register can be specified
|
||||
eq({
|
||||
args = "",
|
||||
fargs = {},
|
||||
bang = false,
|
||||
line1 = 1,
|
||||
line2 = 1,
|
||||
mods = "",
|
||||
smods = {
|
||||
browse = false,
|
||||
confirm = false,
|
||||
emsg_silent = false,
|
||||
hide = false,
|
||||
horizontal = false,
|
||||
keepalt = false,
|
||||
keepjumps = false,
|
||||
keepmarks = false,
|
||||
keeppatterns = false,
|
||||
lockmarks = false,
|
||||
noautocmd = false,
|
||||
noswapfile = false,
|
||||
sandbox = false,
|
||||
silent = false,
|
||||
split = "",
|
||||
tab = -1,
|
||||
unsilent = false,
|
||||
verbose = -1,
|
||||
vertical = false,
|
||||
},
|
||||
range = 0,
|
||||
count = 2,
|
||||
reg = "+",
|
||||
}, exec_lua [[
|
||||
vim.cmd('CommandWithNoArgs +')
|
||||
return result
|
||||
]])
|
||||
|
||||
end)
|
||||
|
||||
|
Reference in New Issue
Block a user