elvish/pkg/ui
Qi Xiao 42c6c3b1aa pkg/ui: Make styled text context-insensitive, and remove the "default" color.
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.
2022-07-24 14:31:02 +01:00
..
color_test.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
color.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
key_test.go Use the integrated persistent package. 2021-05-03 22:17:46 +01:00
key.go Make ttyshots scripted and reproducible 2022-06-19 10:51:29 +01:00
mark_lines_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
mark_lines.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
parse_sgr_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
parse_sgr.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
style_regions_test.go Don't dot import pkg/ui 2022-06-04 23:39:19 +01:00
style_regions.go pkg/ui: Add utility for styling multiple regions in a text. 2021-02-27 23:05:42 +00:00
style_test.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
style.go Make ttyshots scripted and reproducible 2022-06-19 10:51:29 +01:00
styling_test.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
styling.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
text_segment_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
text_segment.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
text_test.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
text.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
ui.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00