ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/src
Martin von Zweigbergk 31ad0cd2ed formatter: reset color around newlines
There are several reasons for this:

 * We can more easily skip styling a trailing blank line, which other
   internal code then can correctly detect as having a trailing
   newline. This fixes the TODO in tests/test_commit_template.rs.

 * Some tools (like `less -R`) add an extra newline if the final
   character is not a newline (e.g. if there's a color reset after
   it), which led to an annoying blank line after the diff summary in
   e.g. `jj status`.

 * Since each line is styled independently, you get all the necessary
   escapes even when grepping through the output.

 * Some terminals extend background color to the end of the terminal
   (i.e. past the newline character), which is probably not what the
   user wanted.

 * Some tools (like `less -R`) get confused and lose coloring of lines
   after a newline.
2023-01-13 21:47:50 -08:00
..
config
cleanup_guard.rs
cli_util.rs
commands.rs
config-schema.json
config.rs
diff_util.rs
formatter.rs formatter: reset color around newlines 2023-01-13 21:47:50 -08:00
graphlog.rs
lib.rs
main.rs
merge_tools.rs
progress.rs
template.pest
template_parser.rs
templater.rs
ui.rs