From 774be7932106721badd5406e0dcf20e917eaa2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=B5=20Anh=20Duy?= Date: Mon, 14 Jun 2021 10:21:36 +0800 Subject: [PATCH] Fix syntax hightlight when using Circumflex-Operator (#3613) --- crates/nu-parser/src/parse.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/nu-parser/src/parse.rs b/crates/nu-parser/src/parse.rs index 0eedc444e4..92d4f27c71 100644 --- a/crates/nu-parser/src/parse.rs +++ b/crates/nu-parser/src/parse.rs @@ -1754,9 +1754,12 @@ fn parse_call( if lite_cmd.parts.is_empty() { return (None, None); } else if lite_cmd.parts[0].item.starts_with('^') { - let name = lite_cmd.parts[0] + let mut name = lite_cmd.parts[0] .clone() .map(|v| v.chars().skip(1).collect::()); + + name.span = Span::new(name.span.start() + 1, name.span.end()); + // TODO this is the same as the `else` branch below, only the name differs. Find a way // to share this functionality. let mut args = vec![];