mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
Merge pull request #24217 from neovim/backport-24161-to-release-0.9
[Backport release-0.9] fix: always set arg0 to lua scripts
This commit is contained in:
commit
3a6235cb81
@ -1358,7 +1358,7 @@ static void command_line_scan(mparm_T *parmp)
|
||||
}
|
||||
parmp->luaf = argv[0];
|
||||
argc--;
|
||||
if (argc > 0) { // Lua args after "-l <file>".
|
||||
if (argc >= 0) { // Lua args after "-l <file>".
|
||||
parmp->lua_arg0 = parmp->argc - argc;
|
||||
argc = 0;
|
||||
}
|
||||
|
@ -148,6 +148,18 @@ describe('startup', function()
|
||||
end)
|
||||
|
||||
it('sets _G.arg', function()
|
||||
-- nvim -l foo.lua
|
||||
assert_l_out([[
|
||||
bufs:
|
||||
nvim args: 3
|
||||
lua args: {
|
||||
[0] = "test/functional/fixtures/startup.lua"
|
||||
}]],
|
||||
{},
|
||||
{}
|
||||
)
|
||||
eq(0, eval('v:shell_error'))
|
||||
|
||||
-- nvim -l foo.lua [args]
|
||||
assert_l_out([[
|
||||
bufs:
|
||||
|
Loading…
Reference in New Issue
Block a user