mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(api): nvim_parse_cmd handle nextcmd for commands without EX_TRLBAR (#36055)
Problem: nvim_parse_cmd('exe "ls"|edit foo', {}) fails to separate
nextcmd, returning args as { '"ls"|edit', 'foo' } instead of { '"ls"' }
with nextcmd='edit foo'.
Solution: Skip expressions before checking for '|' separator.
This commit is contained in:
@@ -4849,6 +4849,12 @@ describe('API', function()
|
||||
result = api.nvim_parse_cmd('copen 5', {})
|
||||
eq(5, result.count)
|
||||
end)
|
||||
it('parses nextcmd for commands #36029', function()
|
||||
local result = api.nvim_parse_cmd('exe "ls"|edit foo', {})
|
||||
eq({ '"ls"' }, result.args)
|
||||
eq('execute', result.cmd)
|
||||
eq('edit foo', result.nextcmd)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_cmd', function()
|
||||
|
||||
Reference in New Issue
Block a user