Commit Graph

3 Commits

Author SHA1 Message Date
Brodie Rao
1ad67ea95f color: don't split colors across lines (which confuses less -R)
Currently, less -R doesn't support colors spanning multiple lines; only
the first line will be colorized.

Instead of allowing colors to span multiple lines, the color extension
now applies colors to each line it receives, even when ui.write() is
given multiple lines in one call.
2010-04-02 15:22:19 -05:00
Brodie Rao
e46074c7b3 color: colorize based on output labels instead of parsing output
By overriding ui.write(), ui.write_err(), ui.popbuffer(), and ui.label(),
the color extension can avoid parsing command output and simply colorize
output based on labels.

As before, the color extension provides a list of default colors for
core commands/labels. Other extensions can provide their own defaults by
specifying a colortable dict (similar to cmdtable).

In this process, --color is promoted to a global option and the deprecated
--no-color option is removed.
2010-04-02 15:22:17 -05:00
Brodie Rao
459206adee color: don't crash on invalid status codes (issue2036)
If an unknown file with a newline appears in the status output, color
shouldn't raise a KeyError trying to parse second line in the filename.
2010-02-14 17:08:52 -05:00