From f1babb322b359262a881ca2dcf6acba73d7e2881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20B=C3=ACnh=20An?= <111893501+brianhuster@users.noreply.github.com> Date: Sat, 12 Jul 2025 08:13:20 +0700 Subject: [PATCH] refactor(qf): move syntax code for qf-toc to qf.lua #34879 --- runtime/syntax/qf.lua | 8 ++++++++ runtime/syntax/qf.vim | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 runtime/syntax/qf.lua diff --git a/runtime/syntax/qf.lua b/runtime/syntax/qf.lua new file mode 100644 index 0000000000..d2d80ffa33 --- /dev/null +++ b/runtime/syntax/qf.lua @@ -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 [[\]] +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 diff --git a/runtime/syntax/qf.vim b/runtime/syntax/qf.vim index f65ddcb6b5..ce6af4989f 100644 --- a/runtime/syntax/qf.vim +++ b/runtime/syntax/qf.vim @@ -18,12 +18,6 @@ syn match qfText ".*" contained syn match qfError "error" contained 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') =~# '\' - setlocal conceallevel=3 concealcursor=nc - syn match Ignore "^[^|]*|[^|]*| " conceal -endif - " The default highlighting. hi def link qfFileName Directory hi def link qfLineNr LineNr