summaryrefslogtreecommitdiff
path: root/rc/tools/python
diff options
context:
space:
mode:
authorChris Webb <chris@arachsys.com>2023-12-10 13:50:29 +0000
committerChris Webb <chris@arachsys.com>2023-12-10 13:50:29 +0000
commit86979841b7ebb32b4f7dfb5da7f3a8fa9c98f43c (patch)
tree72c96b59bfe0fe2fa816259878d0e48b47aa13d2 /rc/tools/python
parent7f49395cf931b2af8a75ffb5319a8aa8c395ed8d (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