feat(help): hide filename of "gO" outline using conceal #27547

Help outlines, invoked by `gO`, displays the help section titles in the
location list window. This feature is implemented by setting the buffer
lines after opening the window, but this implementation breaks the
assumption that the quickfix window texts are consistently constructed
by the quickfix list items. I think we can use the conceal feature here.
Using conceal here improves interoperability between quickfix plugins,
and also simplifies the outline implementation.

Originally reported at https://github.com/itchyny/vim-qfedit/issues/12
This commit is contained in:
itchyny
2024-02-20 20:57:13 +09:00
committed by GitHub
parent a0790558c3
commit ddda5e0a48
3 changed files with 8 additions and 25 deletions

View File

@@ -15,6 +15,12 @@ syn match qfSeparator "|" nextgroup=qfLineNr contained
syn match qfLineNr "[^|]*" contained contains=qfError
syn match qfError "error" contained
" Hide file name and line number for help outline (TOC).
if has_key(w:, 'qf_toc') || get(w:, 'quickfix_title') =~# '\<TOC$'
setlocal conceallevel=3 concealcursor=nc
syn match Ignore "^[^|]*|[^|]*| " conceal
endif
" The default highlighting.
hi def link qfFileName Directory
hi def link qfLineNr LineNr