aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/startup_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-01-01 03:14:13 +0100
committerJustin M. Keyes <justinkz@gmail.com>2023-01-05 17:10:02 +0100
commit45549f031ee52a01601c33acc411f3111cfc4e95 (patch)
treeb9c772a2ba9b0f226f5f6926417d22b0a0f3f207 /test/functional/core/startup_spec.lua
parent599e1d019aa010d4e3c56e6bad3d1c406dda5b0f (diff)
downloadrneovim-45549f031ee52a01601c33acc411f3111cfc4e95.tar.gz
rneovim-45549f031ee52a01601c33acc411f3111cfc4e95.tar.bz2
rneovim-45549f031ee52a01601c33acc411f3111cfc4e95.zip
feat(lua): send "--" literally to Lua "-l" script
Problem: When "-l" is followed by "--", we stop sending args to the Lua script and treat "--" in the usual way. This was for flexibility but didn't have a strong use-case, and has these problems: - prevents Lua "-l" scripts from handling "--" in their own way. - complicates the startup logic (must call nlua_init before command_line_scan) Solution: Don't treat "--" specially if it follows "-l".
Diffstat (limited to 'test/functional/core/startup_spec.lua')
-rw-r--r--test/functional/core/startup_spec.lua23
1 files changed, 15 insertions, 8 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index 1df8d76c97..dbd517995c 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -107,7 +107,8 @@ describe('startup', function()
-- nvim -l foo.lua -arg1 -- a b c
assert_l_out([[
bufs:
- args: { "-arg1", "--exitcode", "73", "--arg2" }]],
+ nvim args: 8
+ lua args: { "-arg1", "--exitcode", "73", "--arg2" }]],
{},
{ '-arg1', "--exitcode", "73", '--arg2' }
)
@@ -118,7 +119,8 @@ describe('startup', function()
-- nvim -l foo.lua -arg1 -- a b c
assert_l_out([[
bufs:
- args: { "-arg1", "--arg2", "arg3" }]],
+ nvim args: 7
+ lua args: { "-arg1", "--arg2", "arg3" }]],
{},
{ '-arg1', '--arg2', 'arg3' }
)
@@ -127,7 +129,8 @@ describe('startup', function()
-- nvim -l foo.lua --
assert_l_out([[
bufs:
- args: {}]],
+ nvim args: 5
+ lua args: { "--" }]],
{},
{ '--' }
)
@@ -135,8 +138,9 @@ describe('startup', function()
-- nvim file1 file2 -l foo.lua -arg1 -- file3 file4
assert_l_out([[
- bufs: file1 file2 file3 file4
- args: { "-arg1", "arg 2" }]],
+ bufs: file1 file2
+ nvim args: 11
+ lua args: { "-arg1", "arg 2", "--", "file3", "file4" }]],
{ 'file1', 'file2', },
{ '-arg1', 'arg 2', '--', 'file3', 'file4' }
)
@@ -145,7 +149,8 @@ describe('startup', function()
-- nvim file1 file2 -l foo.lua -arg1 --
assert_l_out([[
bufs: file1 file2
- args: { "-arg1" }]],
+ nvim args: 8
+ lua args: { "-arg1", "--" }]],
{ 'file1', 'file2', },
{ '-arg1', '--' }
)
@@ -154,7 +159,8 @@ describe('startup', function()
-- nvim -l foo.lua <vim args>
assert_l_out([[
bufs:
- args: { "-c", "set wrap?" }]],
+ nvim args: 6
+ lua args: { "-c", "set wrap?" }]],
{},
{ '-c', 'set wrap?' }
)
@@ -167,7 +173,8 @@ describe('startup', function()
wrap
bufs:
- args: { "-c", "set wrap?" }]],
+ nvim args: 8
+ lua args: { "-c", "set wrap?" }]],
{ '-c', 'set wrap?' },
{ '-c', 'set wrap?' }
)