diff options
| author | Chris Webb <chris@arachsys.com> | 2023-12-10 13:50:29 +0000 |
|---|---|---|
| committer | Chris Webb <chris@arachsys.com> | 2023-12-10 13:50:29 +0000 |
| commit | 86979841b7ebb32b4f7dfb5da7f3a8fa9c98f43c (patch) | |
| tree | 72c96b59bfe0fe2fa816259878d0e48b47aa13d2 /rc/tools/python | |
| parent | 7f49395cf931b2af8a75ffb5319a8aa8c395ed8d (diff) | |
Improve c-family highlighting of preprocessor directives
The current handling of preprocessor directives in filetype/c-family.kak
leads to a wall of solid colour for more complicated #if or #define
directives, although #include is already nicely highlighted.
Instead of highlighting an entire directive with the meta face, highlight
just the #define, #if or #elif keyword as meta, treating the rest of the
directive as normal c-family expressions. This significantly improves
the readability of complex macro definitions.
For directives other than #define, #if and #elif, we treat the rest of
the directive as an opaque string in normal face rather than trying to
highlight it, covering cases like #error, #pragma, etc. where the rest
of the line is an error message string or other non-expression content.
This does the right thing for #ifdef and #ifndef too, as we don't highlight
identifiers in c-family text so their arguments should be normal face
anyway.
Diffstat (limited to 'rc/tools/python')
0 files changed, 0 insertions, 0 deletions
