fix(runtime): conceal paths in help, man ToC loclist #33764

Problem:
The check for concealing paths in TOCs in the qf syntax file fails
because the TOC tile has changed.

Solution:
Force the qf syntax file to be reloaded after the qf_toc variable
has been set, so that the it can apply the correct settings.

Using the explicit qf_toc key, already used in the syntax file, instead
of the title is less prone to breaking.

It was also already being set for man pages but it had no effect because
the syntax file had already been loaded when the variable was set.

Fixes #33733
This commit is contained in:
Michele Campeotto
2025-05-03 16:06:22 +02:00
committed by GitHub
parent 6b233cd1a1
commit f048298e9a
2 changed files with 6 additions and 0 deletions

View File

@@ -823,6 +823,8 @@ function M.show_toc()
fn.setloclist(0, {}, 'a', { title = 'Table of contents' })
vim.cmd.lopen()
vim.w.qf_toc = bufname
-- reload syntax file after setting qf_toc variable
vim.bo.filetype = 'qf'
end
return M