diff --git a/src/error.rs b/src/error.rs index 840c753..bc6db85 100644 --- a/src/error.rs +++ b/src/error.rs @@ -66,7 +66,7 @@ impl Display for SassError { "{}| {}{}", padding, vec![' '; loc.begin.column].iter().collect::(), - vec!['^'; loc.end.column - loc.begin.column] + vec!['^'; loc.end.column.max(loc.begin.column) - loc.begin.column.min(loc.end.column)] .iter() .collect::() )?; diff --git a/tests/if.rs b/tests/if.rs index 13f8add..34bb47c 100644 --- a/tests/if.rs +++ b/tests/if.rs @@ -130,3 +130,4 @@ error!(unclosed_dbl_quote, "@if true \" {}", "Error: Expected \"."); error!(unclosed_sgl_quote, "@if true ' {}", "Error: Expected '."); error!(unclosed_call_args, "@if a({}", "Error: expected \")\"."); error!(nothing_after_div, "@if a/", "Error: Expected expression."); +error!(multiline_error, "@if \"\n\"{}", "Error: Expected \".");