aboutsummaryrefslogtreecommitdiffstats
path: root/filters/vectors/colorize-patch.expected
Commit message (Collapse)AuthorAgeFilesLines
* colorize: support trailing comments after valuesRobin Jarry2023-09-191-9/+9
| | | | | | | | Strip trailing comments after attribute values in stylesets. Update the test styleset to check it works. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
* colorize: handle spaces in stylesetRobin Jarry2023-09-041-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid failure when the styleset [viewer] section contains spaces: ~$ cat foo [viewer] url.fg = #ffffaf url.underline = true header.fg = #af87ff signature.fg = #af87ff diff_meta.fg = #ffffff diff_meta.bold = true diff_chunk.fg = #00cdcd diff_add.fg = #00cd00 diff_del.fg = #cd0000 quote_1.fg = #5fafff quote_2.fg = #ff8700 quote_3.fg = #af87ff quote_4.fg = #ff5fd7 quote_x.fg = #808080 ~$ ./colorize -s foo < bar.eml error: invalid style attribute 'fg ' Be more restrictive with what characters are part of a style attribute. Add test styleset with as much weirdness as possible. Update vectors accordingly. Update sendemail-validate hook to export pedantic CFLAGS. Reported-by: Tristan Partin <tristan@partin.io> Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tristan Partin <tristan@partin.io>
* colorize: style chunk function nameJason Cox2023-05-161-1/+1
| | | | | | | | | 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>
* colorize: don't print an id in osc8 terminatorTim Culverhouse2023-04-151-2/+2
| | | | | | | | | | | Printing an ID in the OSC8 terminator can cause issues in some pagers and/or terminals. The "spec" doesn't allow for an ID in the terminator, but most applications and terminals will ignore it if it's there. Prevent printing it in the first place for better compatibility. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Robin Jarry <robin@jarry.cc>
* colorize: emit OSC 8 for URLs and emailsKirill Chibisov2023-03-261-2/+2
| | | | | | | | | | Mark URLs with OSC 8 escape sequence to help terminal emulators with opening multi-line URLs with the mouse and attach the hyperlink to email addresses, so the users could open them. Link: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda Signed-off-by: Kirill Chibisov <contact@kchibisov.com> Acked-by: Robin Jarry <robin@jarry.cc>
* colorize: restore previous default themeRobin Jarry2023-02-021-31/+31
| | | | | | | | | | | Restore the default theme from the previous colorize awk script. It is more colorful and may be more appealing to new users out of the box. Since colorize is now configurable via stylesets, power users can do whatever they like. Requested-by: Andrea Pappacoda <andrea@pappacoda.it> Signed-off-by: Robin Jarry <robin@jarry.cc> Agreed-by: Bence Ferdinandy <bence@ferdinandy.com>
* filters: rewrite colorize in cRobin Jarry2023-01-261-0/+49
Since its introduction, we had multiple issues with the colorize awk script with regard to non-GNU awk compatibility. Also, this script is standalone and the color theme must be hard coded into it. Reading from an external configuration file (aerc's styleset) from a non-GNU awk is close to impossible (and even far from trivial with GNU awk). Rewrite the builtin colorize filter in C to allow getting the color theme from aerc's active styleset. The theme is configured using the existing styleset syntax and attributes under a separate [viewer] section (see examples and man page). Export the active styleset file path to AERC_STYLESET env var when invoking the filter command so that colorize can access it and use it. I have tested compilation (with clang-analyzer and gcc -fanalyzer) and basic operation on FreeBSD, Fedora (glibc) and Alpine (muslibc). More tests would probably be required on MacOSX and older Linux distros. I also added test vectors to give some confidence that this works as expected. The execution with these vectors passed valgrind --leak-check=full without errors. NB: the default theme has changed to be more minimal. Sample stylesets have more colorful examples. The awk -v theme=xxx option is no longer supported. usage: colorize [-h] [-s FILE] [-f FILE] options: -h show this help message -s FILE use styleset file (default $AERC_STYLESET) -f FILE read from filename (default stdin) Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>