mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
42c6c3b1aa
Styled text is not supposed to "inherit" the current SGR styling context when written to the terminal. This has always been the intention, but not correctly implemented. This commit fixes that for both styled segments and styled texts. Tests are amended to account for the difference in the output. With context insensitivity correctly implemented, there is now no need for a "default" color. It is functionally equivalent to a lack of color. The parsing of SGR still needs to be aware of the codes 39 (default foreground) and 49 (default background), but these codes are now translated into FgDefault and BgDefault, which resets the foreground and background color fields. |
||
---|---|---|
.. | ||
color_test.go | ||
color.go | ||
key_test.go | ||
key.go | ||
mark_lines_test.go | ||
mark_lines.go | ||
parse_sgr_test.go | ||
parse_sgr.go | ||
style_regions_test.go | ||
style_regions.go | ||
style_test.go | ||
style.go | ||
styling_test.go | ||
styling.go | ||
text_segment_test.go | ||
text_segment.go | ||
text_test.go | ||
text.go | ||
ui.go |