mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
test: clear(): remove opts.headless parameter
Callers can instead specify `args_rm={'--headless'}`.
TODO: should `nvim_argv` have "--headless" by default? Need to inspect
some uses of spawn(nvim_argv) ...
This commit is contained in:
@@ -394,17 +394,16 @@ end
|
||||
-- removed, e.g. args_rm={'--cmd'} removes all cases of "--cmd"
|
||||
-- (and its value) from the default set.
|
||||
-- env: Map: Defines the environment of the new session.
|
||||
-- headless: Boolean (default=true): Append --headless arg.
|
||||
--
|
||||
-- Example:
|
||||
-- clear('-e')
|
||||
-- clear{args={'-e'}, args_rm={'-i'}, env={TERM=term}}
|
||||
local function clear(...)
|
||||
local args = {unpack(nvim_argv)}
|
||||
table.insert(args, '--headless')
|
||||
local new_args
|
||||
local env = nil
|
||||
local opts = select(1, ...)
|
||||
local headless = true
|
||||
if type(opts) == 'table' then
|
||||
args = remove_args(args, opts.args_rm)
|
||||
if opts.env then
|
||||
@@ -432,15 +431,9 @@ local function clear(...)
|
||||
end
|
||||
end
|
||||
new_args = opts.args or {}
|
||||
if opts.headless == false then
|
||||
headless = false
|
||||
end
|
||||
else
|
||||
new_args = {...}
|
||||
end
|
||||
if headless then
|
||||
table.insert(args, '--headless')
|
||||
end
|
||||
for _, arg in ipairs(new_args) do
|
||||
table.insert(args, arg)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user