aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
authoritchyny <itchyny@cybozu.co.jp>2024-02-20 20:57:13 +0900
committerGitHub <noreply@github.com>2024-02-20 03:57:13 -0800
commitddda5e0a488bce19c86e04fa823069b755fac779 (patch)
tree31857e5b8b9bc6b8b14151d5e61d236e2301d97f /runtime/syntax
parenta0790558c3097f2813c56e404af30c3e2d8b8983 (diff)
downloadrneovim-ddda5e0a488bce19c86e04fa823069b755fac779.tar.gz
rneovim-ddda5e0a488bce19c86e04fa823069b755fac779.tar.bz2
rneovim-ddda5e0a488bce19c86e04fa823069b755fac779.zip
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
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/qf.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/syntax/qf.vim b/runtime/syntax/qf.vim
index 6f2ea6a92e..3131caccd8 100644
--- a/runtime/syntax/qf.vim
+++ b/runtime/syntax/qf.vim
@@ -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