mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 02:13:47 +01:00
touchup alias highlight
This commit is contained in:
parent
40004e64a6
commit
1a3e1e0959
@ -814,6 +814,7 @@ impl<'a> ParserWorkingSet<'a> {
|
||||
|
||||
if expand_aliases {
|
||||
if let Some(expansion) = self.find_alias(name) {
|
||||
let orig_span = spans[pos];
|
||||
//let mut spans = spans.to_vec();
|
||||
let mut new_spans: Vec<Span> = vec![];
|
||||
new_spans.extend(&spans[0..pos]);
|
||||
@ -822,7 +823,25 @@ impl<'a> ParserWorkingSet<'a> {
|
||||
new_spans.extend(&spans[(pos + 1)..]);
|
||||
}
|
||||
|
||||
return self.parse_call(&new_spans, false);
|
||||
let (result, err) = self.parse_call(&new_spans, false);
|
||||
|
||||
let expression = match result {
|
||||
Expression {
|
||||
expr: Expr::Call(mut call),
|
||||
span,
|
||||
ty,
|
||||
} => {
|
||||
call.head = orig_span;
|
||||
Expression {
|
||||
expr: Expr::Call(call),
|
||||
span,
|
||||
ty,
|
||||
}
|
||||
}
|
||||
x => x,
|
||||
};
|
||||
|
||||
return (expression, err);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user