From cb8b7e08a58dfe459155d4e31f17bc95131500ec Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:37:45 +1100 Subject: [PATCH] Lex comment spans correctly (#657) --- crates/nu-parser/src/lex.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-parser/src/lex.rs b/crates/nu-parser/src/lex.rs index e374a29042..fb807e35da 100644 --- a/crates/nu-parser/src/lex.rs +++ b/crates/nu-parser/src/lex.rs @@ -280,7 +280,7 @@ pub fn lex( if !skip_comment { output.push(Token::new( TokenContents::Comment, - Span::new(start, curr_offset), + Span::new(span_offset + start, span_offset + curr_offset), )); } start = curr_offset;