forked from extern/nushell
Patch restore lead trail space bg color (#10351)
```nu $env.config.color_config.leading_trailing_space_bg = { bg: 'white' }; [[a b, 'c ']; [' 1 ' ' 2' '3 '] [' 4 ' "hello \n world " [' 1 ' 2 [1 ' 2 ' 3]]]] | table --expand ```  ref: #2794 close: #10317 note: test are not actually make scenes cause `nu!` strips colors. (Ideally it would need a flag to not do so) note: It does does does ... slower down quite a bit rendering... ( PS: Maybe it's better being a flag to `table` rather then a configuration option? PS: I am not sure why the logic was removed in a first place
This commit is contained in:
@ -62,6 +62,16 @@ pub fn get_index_style(style_computer: &StyleComputer) -> TextStyle {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_leading_trailing_space_style(style_computer: &StyleComputer) -> TextStyle {
|
||||
TextStyle::with_style(
|
||||
Alignment::Right,
|
||||
style_computer.compute(
|
||||
"leading_trailing_space_bg",
|
||||
&Value::string("", Span::unknown()),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_value_style(value: &Value, config: &Config, style_computer: &StyleComputer) -> NuText {
|
||||
match value {
|
||||
// Float precision is required here.
|
||||
|
Reference in New Issue
Block a user