mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
fix(usercmd): also check for whitespace after escaped character (#19942)
This commit is contained in:
@@ -1061,11 +1061,11 @@ bool uc_split_args_iter(const char *arg, size_t arglen, size_t *end, char *buf,
|
|||||||
buf[l++] = arg[++pos];
|
buf[l++] = arg[++pos];
|
||||||
} else {
|
} else {
|
||||||
buf[l++] = arg[pos];
|
buf[l++] = arg[pos];
|
||||||
if (ascii_iswhite(arg[pos + 1])) {
|
}
|
||||||
*end = pos + 1;
|
if (ascii_iswhite(arg[pos + 1])) {
|
||||||
*len = l;
|
*end = pos + 1;
|
||||||
return false;
|
*len = l;
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -114,8 +114,8 @@ describe('nvim_create_user_command', function()
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
eq({
|
eq({
|
||||||
args = [[this is a\ test]],
|
args = [[this\ is a\ test]],
|
||||||
fargs = {"this", "is", "a test"},
|
fargs = {"this ", "is", "a test"},
|
||||||
bang = false,
|
bang = false,
|
||||||
line1 = 1,
|
line1 = 1,
|
||||||
line2 = 1,
|
line2 = 1,
|
||||||
@@ -144,7 +144,7 @@ describe('nvim_create_user_command', function()
|
|||||||
count = 2,
|
count = 2,
|
||||||
reg = "",
|
reg = "",
|
||||||
}, exec_lua [=[
|
}, exec_lua [=[
|
||||||
vim.api.nvim_command([[CommandWithLuaCallback this is a\ test]])
|
vim.api.nvim_command([[CommandWithLuaCallback this\ is a\ test]])
|
||||||
return result
|
return result
|
||||||
]=])
|
]=])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user