diff options
author | Jason Cox <me@jasoncarloscox.com> | 2023-04-27 09:57:37 -0400 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-05-16 13:41:41 +0200 |
commit | d2ea1aac09fbf02873c3070cadef4386196bb040 (patch) | |
tree | 467a77462082f2fc05972517bf88afd200f0c008 /filters | |
parent | bbb9b0695e1b8a0962423f5223a4b559b4ef02f6 (diff) | |
download | aerc-d2ea1aac09fbf02873c3070cadef4386196bb040.tar.gz |
colorize: style chunk function name
It's nice to use a different style for the chunk's function name to make
it clear that the name is not necessarily adjacent to the chunk's actual
lines.
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'filters')
-rw-r--r-- | filters/colorize.c | 7 | ||||
-rw-r--r-- | filters/vectors/colorize-patch.expected | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/filters/colorize.c b/filters/colorize.c index 1c979d11..6f988158 100644 --- a/filters/colorize.c +++ b/filters/colorize.c @@ -144,6 +144,7 @@ struct styles { struct style signature; struct style diff_meta; struct style diff_chunk; + struct style diff_chunk_func; struct style diff_add; struct style diff_del; struct style quote_1; @@ -160,7 +161,8 @@ static struct styles styles = { .header = { .bold = true, .fg = { .type = RGB, .rgb = 0xaf87ff } }, .signature = { .dim = true, .fg = { .type = RGB, .rgb = 0xaf87ff } }, .diff_meta = { .bold = true, .fg = { .type = RGB, .rgb = 0xffffff } }, - .diff_chunk = { .fg = { .type = RGB, .rgb = 0x00cdcd } }, + .diff_chunk = { .bold = true, .fg = { .type = RGB, .rgb = 0x00cdcd } }, + .diff_chunk_func = { .fg = { .type = RGB, .rgb = 0x00cdcd } }, .diff_add = { .fg = { .type = RGB, .rgb = 0x00cd00 } }, .diff_del = { .fg = { .type = RGB, .rgb = 0xcd0000 } }, .quote_1 = { .fg = { .type = RGB, .rgb = 0x5fafff } }, @@ -322,6 +324,7 @@ static struct {const char *n; struct style *s;} ini_objects[] = { {"signature", &styles.signature}, {"diff_meta", &styles.diff_meta}, {"diff_chunk", &styles.diff_chunk}, + {"diff_chunk_func", &styles.diff_chunk_func}, {"diff_add", &styles.diff_add}, {"diff_del", &styles.diff_del}, {"quote_1", &styles.quote_1}, @@ -441,7 +444,9 @@ static void diff_chunk(const char *in) len++; in += print_notabs(in, len); print(RESET); + print(seq(&styles.diff_chunk_func)); print_notabs(in, BUFSIZ); + print(RESET); } static inline bool isurichar(char c) diff --git a/filters/vectors/colorize-patch.expected b/filters/vectors/colorize-patch.expected index e9124672..733f7628 100644 --- a/filters/vectors/colorize-patch.expected +++ b/filters/vectors/colorize-patch.expected @@ -14,7 +14,7 @@ According to scdoc(5), numbered lists start with a period. [1;38;2;255;255;255mindex d82ba7cf8163..34bbf4af0fc5 100644[0m [1;38;2;255;255;255m--- a/doc/aerc-stylesets.7.scd[0m [1;38;2;255;255;255m+++ b/doc/aerc-stylesets.7.scd[0m -[38;2;0;205;205m@@ -180,20 +180,20 @@[0m that style applies, unless overridden by a higher layer. +[1;38;2;0;205;205m@@ -180,20 +180,20 @@[0m[38;2;0;205;205m that style applies, unless overridden by a higher layer.[0m The order that *msglist_\** styles are applied in is, from first to last: |