elvish/pkg/eval
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
..
errs Fix typos and add codespell to CI 2021-08-22 23:07:34 +01:00
evaltest evaltest: Fix diff output. 2022-04-07 20:46:30 +01:00
vals pkg/eval/vals: Replace MakeListFromStrings with a generic MakeListSlice. 2022-06-17 16:50:38 +01:00
vars pkg/eval/vars: Deexport EnvVariable, use Unset/IsSet via interface 2022-06-05 21:47:51 +01:00
benchmarks_test.go pkg/eval: Reorganize benchmarks. 2021-12-02 00:30:01 +00:00
builtin_fn_cmd_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
builtin_fn_cmd_unix_test.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
builtin_fn_cmd_unix.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_cmd_windows.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_cmd.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_container_test.go Properly deprecate float64. 2022-04-09 11:45:15 +01:00
builtin_fn_container.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_debug.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_env_test.go Remove most uses of the legacy assignment syntax. 2022-01-03 00:47:41 +00:00
builtin_fn_env.go Document relationship between *-env commands and E: namespace. 2022-05-22 20:13:17 +01:00
builtin_fn_flow_test.go Add a new "defer" command. 2022-01-05 00:12:35 +00:00
builtin_fn_flow.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_fs_test.go Remove most uses of the legacy assignment syntax. 2022-01-03 00:47:41 +00:00
builtin_fn_fs.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_io_test.go Clarify error message when writing values to port not supporting it. 2022-06-07 20:29:34 +01:00
builtin_fn_io.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_misc_test.go Properly deprecate float64. 2022-04-09 11:45:15 +01:00
builtin_fn_misc_unix_test.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
builtin_fn_misc.go Make init value of $f~ actually identical to $nop~. 2022-06-07 20:20:00 +01:00
builtin_fn_num_test.go Properly deprecate float64. 2022-04-09 11:45:15 +01:00
builtin_fn_num.go Properly deprecate float64. 2022-04-09 11:45:15 +01:00
builtin_fn_pred_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
builtin_fn_pred.go Properly deprecate float64. 2022-04-09 11:45:15 +01:00
builtin_fn_str_test.go Replace AnyError in tests with a specific error 2021-12-13 01:08:24 +00:00
builtin_fn_str.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_fn_stream.go Properly deprecate float64. 2022-04-09 11:45:15 +01:00
builtin_fn_styled_test.go pkg/ui: Make styled text context-insensitive, and remove the "default" color. 2022-07-24 14:31:02 +01:00
builtin_fn_styled.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
builtin_ns_test.go Fix use of the builtin module via explicit "builtin". 2021-10-28 22:28:13 +01:00
builtin_ns.go Make init value of $f~ actually identical to $nop~. 2022-06-07 20:20:00 +01:00
builtin_special_test.go Make init value of $f~ actually identical to $nop~. 2022-06-07 20:20:00 +01:00
builtin_special.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
callable.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
chdir_test.go pkg/eval: Remove access methods for exported fields. 2022-06-18 19:01:59 +01:00
closure_test.go Remove most uses of the legacy assignment syntax. 2022-01-03 00:47:41 +00:00
closure.go pkg/eval/vals: Replace MakeListFromStrings with a generic MakeListSlice. 2022-06-17 16:50:38 +01:00
compile_effect_test.go Clarify error message when writing values to port not supporting it. 2022-06-07 20:29:34 +01:00
compile_effect_unix_test.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
compile_effect.go Clarify error message when writing values to port not supporting it. 2022-06-07 20:29:34 +01:00
compile_lvalue.go pkg/eval/vars: Deexport EnvVariable, use Unset/IsSet via interface 2022-06-05 21:47:51 +01:00
compile_value_test.go Fixup for #1531. 2022-06-11 21:26:32 +01:00
compile_value.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
compiler_test.go Make parse.Source naming more consistent 2022-05-29 17:36:29 +01:00
compiler.go Properly deprecate float64. 2022-04-09 11:45:15 +01:00
deprecation.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
eval_test.go pkg/eval: Remove access methods for exported fields. 2022-06-18 19:01:59 +01:00
eval.go pkg/eval: Remove access methods for exported fields. 2022-06-18 19:01:59 +01:00
exception_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
exception_unix_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
exception.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
external_cmd_test.go evaltest: Check that stderr is empty if PrintsStderrWith is not called. 2022-03-20 09:50:05 +00:00
external_cmd_unix_internal_test.go Don't dot import pkg/testutil 2022-06-04 23:39:19 +01:00
external_cmd_unix_test.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
external_cmd_unix.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
external_cmd_windows_test.go Fix some lint warnings found on Windows. 2022-06-05 22:01:16 +01:00
external_cmd_windows.go Detect and suppress SIGPIPE caused by the next command in a pipeline exiting early. 2021-05-20 00:10:17 +01:00
external_cmd.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
frame.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
fuzz_test.go Make parse.Source naming more consistent 2022-05-29 17:36:29 +01:00
glob_test.go pkg/eval: Slightly improve coverage of glob.go. 2021-09-10 19:08:22 +01:00
glob.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
go_fn_internal_test.go pkg/eval: Convert elements of slice return value from a GoFn to individual outputs. 2021-10-03 16:34:52 +01:00
go_fn_test.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
go_fn.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
interrupts.go Use buffered channels with signal.Notify. 2021-08-23 00:22:11 +01:00
node_utils.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
ns_test.go Remove most uses of the legacy assignment syntax. 2022-01-03 00:47:41 +00:00
ns.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
options_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
options.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
plugin_gccgo.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
plugin.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
port_helper_test.go Remove most uses of the ioutil package. 2021-08-23 00:36:26 +01:00
port_unix.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
port_windows.go pkg/eval: Fix EPIPE on Windows. 2021-06-18 00:45:25 +01:00
port.go Clarify error message when writing values to port not supporting it. 2022-06-07 20:29:34 +01:00
process_unix.go Require Go 1.18. 2022-03-20 15:28:23 +00:00
process_windows.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
purely_eval_test.go Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
purely_eval.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
pwd_test.go evaltest: Check that stderr is empty if PrintsStderrWith is not called. 2022-03-20 09:50:05 +00:00
pwd.go interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
value_test.go Fixup for #1531. 2022-06-11 21:26:32 +01:00
var_parse_test.go Don't dot import pkg/tt 2022-06-04 23:39:19 +01:00
var_parse.go A couple of TODO cleanups 2021-05-30 00:40:42 +01:00
var_ref.go Remove support for the "local:", "up:" and ":" special namespaces. 2022-01-03 00:47:41 +00:00