Fix syntax highlighting for not (#12815)

# Description
Fixes #12813 where a panic occurs when syntax highlighting `not`. Also
fixes #12814 where syntax highlighting for `not` no longer works.

# User-Facing Changes
Bug fix.
This commit is contained in:
Ian Manske
2024-05-09 23:09:44 +00:00
committed by GitHub
parent 7271ad7909
commit 1b2e680059
7 changed files with 12 additions and 2 deletions

View File

@ -180,12 +180,12 @@ fn flatten_expression_into(
flatten_expression_into(working_set, op, output);
flatten_expression_into(working_set, rhs, output);
}
Expr::UnaryNot(expr) => {
Expr::UnaryNot(not) => {
output.push((
Span::new(expr.span.start, expr.span.start + 3),
FlatShape::Operator,
));
flatten_expression_into(working_set, expr, output);
flatten_expression_into(working_set, not, output);
}
Expr::Closure(block_id) => {
let outer_span = expr.span;