mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
refactor(qf): move syntax code for qf-toc to qf.lua #34879
This commit is contained in:
8
runtime/syntax/qf.lua
Normal file
8
runtime/syntax/qf.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
--- Hide file name and line number for filetype outline (TOC)
|
||||||
|
local w = vim.w
|
||||||
|
local qf_toc_title_regex = vim.regex [[\<TOC$\|\<Table of contents\>]]
|
||||||
|
if w.qf_toc or (w.quickfix_title and qf_toc_title_regex:match_str(w.quickfix_title)) then
|
||||||
|
vim.wo.conceallevel = 3
|
||||||
|
vim.wo.concealcursor = 'nc'
|
||||||
|
vim.cmd [[syn match Ignore "^[^|]*|[^|]*| " conceal]]
|
||||||
|
end
|
@ -18,12 +18,6 @@ syn match qfText ".*" contained
|
|||||||
syn match qfError "error" contained
|
syn match qfError "error" contained
|
||||||
syn cluster qfType contains=qfError
|
syn cluster qfType contains=qfError
|
||||||
|
|
||||||
" Hide file name and line number for help outline (TOC).
|
|
||||||
if has_key(w:, 'qf_toc') || get(w:, 'quickfix_title') =~# '\<TOC$\|\<Table of contents\>'
|
|
||||||
setlocal conceallevel=3 concealcursor=nc
|
|
||||||
syn match Ignore "^[^|]*|[^|]*| " conceal
|
|
||||||
endif
|
|
||||||
|
|
||||||
" The default highlighting.
|
" The default highlighting.
|
||||||
hi def link qfFileName Directory
|
hi def link qfFileName Directory
|
||||||
hi def link qfLineNr LineNr
|
hi def link qfLineNr LineNr
|
||||||
|
Reference in New Issue
Block a user