Allow aliases to expand and ignore painting outside of lines (#3492)

This commit is contained in:
JT
2021-05-26 17:58:32 +12:00
committed by GitHub
parent 1ee51f2afa
commit 41834d16d6
3 changed files with 19 additions and 1 deletions

View File

@ -374,6 +374,10 @@ impl FromValue for Vec<Value> {
value: UntaggedValue::Table(t),
..
} => Ok(t.clone()),
Value {
value: UntaggedValue::Row(_),
..
} => Ok(vec![v.clone()]),
Value { tag, .. } => Err(ShellError::labeled_error(
"Can't convert to table",
"can't convert to table",

View File

@ -46,7 +46,9 @@ impl Painter {
fn paint(&mut self, styled_span: &Spanned<Style>) {
for pos in styled_span.span.start()..styled_span.span.end() {
self.styles[pos] = styled_span.item;
if pos < self.styles.len() {
self.styles[pos] = styled_span.item;
}
}
}