mirror of
https://github.com/neovim/neovim.git
synced 2026-09-02 12:23:50 +00:00
fix(help): :helptags regressions
Problem: Parent commit regressed some behavior of the old C helptags-gen impl: - helpfiles in sub-directories are named by basename, so :help fails - "help-tags" always names "tags", never "tags-nl" - E150 E151 E152 E153 are never reported - existing tags file is not overwritten if no tags were found - a duplicate tag aborts the run, skipping the remaining directories - `*.TXT` and `*.FRX` (uppercase) are not recognized as helpfiles - tree-sitter-vimdoc accepts tags that the C parser rejected: `*a|b*` (breaks |links|) and unterminated `*tag` - PUC Lua "<" compares with (localized) `strcoll()`, so the tags file is not sorted by byte value (E432) - requiring `vim.treesitter` at load time breaks :help itself, not just :helptags, where the module is unavailable - `vim.pack` runs :helptags for plugins that have no "doc/" directory, so every install/update emits E150 Solution: - Fail the build if generating helptags reports any `v:errmsg`. - Restore old behavior: tags generated for runtime/doc are now identical to those from the C implementation. Errors are non-fatal messages instead of exceptions, so all directories are still processed. - Load treesitter lazily, report a plain error if parser is missing.
This commit is contained in:
@@ -835,11 +835,12 @@ local function checkout(p, timestamp, skip_stash)
|
||||
plugin_lock.plugins[p.spec.name].rev = p.info.sha_target
|
||||
|
||||
-- (Re)Generate help tags according to the current help files.
|
||||
-- Also use `pcall()` because `:helptags` errors if there is no 'doc/'
|
||||
-- directory or if it is empty.
|
||||
-- Also use `pcall()` because `:helptags` errors if 'doc/' has no help files.
|
||||
local doc_dir = vim.fs.joinpath(p.path, 'doc')
|
||||
vim.fn.delete(vim.fs.joinpath(doc_dir, 'tags'))
|
||||
copcall(vim.cmd.helptags, { doc_dir, magic = { file = false } })
|
||||
if vim.fn.isdirectory(doc_dir) == 1 then
|
||||
copcall(vim.cmd.helptags, { doc_dir, magic = { file = false } })
|
||||
end
|
||||
end
|
||||
|
||||
--- @param plug_list vim.pack.Plug[]
|
||||
|
||||
Reference in New Issue
Block a user