diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2022-09-25 02:20:47 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2022-09-28 18:34:20 +0200 |
commit | 16336c486ecb5a60e85a870904316308c7d7fc3f (patch) | |
tree | 887ccb63a5184b32dd45bf27261701e23c2fdeeb /test/functional/helpers.lua | |
parent | 7b4c49888a97c21f346b8337330fbc8e196b9cf8 (diff) | |
download | rneovim-16336c486ecb5a60e85a870904316308c7d7fc3f.tar.gz rneovim-16336c486ecb5a60e85a870904316308c7d7fc3f.tar.bz2 rneovim-16336c486ecb5a60e85a870904316308c7d7fc3f.zip |
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
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index eff54b6d4a..3aec834bea 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -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 |