mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
feat(gen_help_html.lua): adapt to new parser
- adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16 - numerous other generator improvements
This commit is contained in:
@@ -29,6 +29,7 @@ local module = {
|
||||
}
|
||||
|
||||
local start_dir = lfs.currentdir()
|
||||
local runtime_set = 'set runtimepath^=./build/lib/nvim/'
|
||||
module.nvim_prog = (
|
||||
os.getenv('NVIM_PRG')
|
||||
or global_helpers.test_build_dir .. '/bin/nvim'
|
||||
@@ -40,6 +41,8 @@ module.nvim_set = (
|
||||
..' belloff= wildoptions-=pum joinspaces noshowcmd noruler nomore redrawdebug=invalid')
|
||||
module.nvim_argv = {
|
||||
module.nvim_prog, '-u', 'NONE', '-i', 'NONE',
|
||||
-- XXX: find treesitter parsers.
|
||||
'--cmd', runtime_set,
|
||||
'--cmd', module.nvim_set,
|
||||
'--cmd', 'mapclear',
|
||||
'--cmd', 'mapclear!',
|
||||
@@ -345,14 +348,17 @@ end
|
||||
|
||||
-- Removes Nvim startup args from `args` matching items in `args_rm`.
|
||||
--
|
||||
-- "-u", "-i", "--cmd" are treated specially: their "values" are also removed.
|
||||
-- - Special case: "-u", "-i", "--cmd" are treated specially: their "values" are also removed.
|
||||
-- - Special case: "runtimepath" will remove only { '--cmd', 'set runtimepath^=…', }
|
||||
--
|
||||
-- Example:
|
||||
-- args={'--headless', '-u', 'NONE'}
|
||||
-- args_rm={'--cmd', '-u'}
|
||||
-- Result:
|
||||
-- {'--headless'}
|
||||
--
|
||||
-- All cases are removed.
|
||||
-- All matching cases are removed.
|
||||
--
|
||||
-- Example:
|
||||
-- args={'--cmd', 'foo', '-N', '--cmd', 'bar'}
|
||||
-- args_rm={'--cmd', '-u'}
|
||||
@@ -373,6 +379,9 @@ local function remove_args(args, args_rm)
|
||||
last = ''
|
||||
elseif tbl_contains(args_rm, arg) then
|
||||
last = arg
|
||||
elseif arg == runtime_set and tbl_contains(args_rm, 'runtimepath') then
|
||||
table.remove(new_args) -- Remove the preceding "--cmd".
|
||||
last = ''
|
||||
else
|
||||
table.insert(new_args, arg)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user