please check $VIMRUNTIM/syntax/qf.vim
The built-in quickfix syntax defines qfError/qfWarning/qfNote through
the qfType cluster:
syn cluster qfType contains=qfError,qfWarning,qfNote,qfInfo
but the cluster is only contained by qfLineNr:
syn match qfLineNr "[^|]*" contained nextgroup=qfSeparator2 contains=@qfType
The default quickfix display format is:
filename|line|text
so compiler messages are displayed in qfText, not qfLineNr.
For example:
main.c|42 col 5|error: undeclared identifier
"error" is part of qfText, therefore qfError never matches.
qfType should be contained by qfText:
syn match qfText ".*" contained contains=@qfType
so qfError/qfWarning/qfNote work for normal compiler output.
qfType should be contained by qfText:
syn match qfText ".*" contained contains=@qfType
so qfError/qfWarning/qfNote work for normal compiler output.
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 23 2025 00:48:59) Included patches: 1-948, 950-1230, 1242, 1244
OS: debian 13 x86_64
Terminal: Alacritty
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
The default output format is, in full, filename|line-range col col-range error-type error-nr| message.
qfType is not intended to match any "error" string in the compiler message field but strictly one of the supported error types, matched by the 'efm' %t specifier and displayed in the error-type field.
Note: Multiline prefix specifiers %E, %W etc also generate an error type.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Thank you for the explanation! I understand now that qfType is intended to match the %t field.
I found that my issue was caused by using an errorformat without %t, for example:
%f:%l:%c:%m
%f:%l:%m
In that case, GCC diagnostics such as "error:" and "warning:" remain in the message field, so qfError/qfWarning cannot match them.
After loading the built-in GCC compiler definition with:
:compiler gcc
the errorformat uses rules such as:
%f:%l:%c: %trror: %m
%f:%l:%c: %tarning: %m
and qfType works as intended.
Sorry for the confusion. This was caused by my Vim setup not loading the GCC compiler definition.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()