Ensure that blank lines in multiline strings are shown as changed

Fixes #121
pull/185/head
Wilfred Hughes 2022-03-23 22:45:36 +07:00
parent 886c0964ff
commit 2b36a755f0
5 changed files with 20 additions and 2 deletions

@ -18,6 +18,9 @@ would be excluded from context.
Fixed an issue where lines containing only whitespace would be
highlighted in purple.
Fixed an issue with changed multiline strings where blank lines were
not highlighted.
Improved Clojure syntax highlighting.
### Parsing

@ -67,6 +67,9 @@ sample_files/modules_before.ml sample_files/modules_after.ml
sample_files/multibyte_before.py sample_files/multibyte_after.py
8a5e31775d5e788e9158bd4a36e03254 -
sample_files/multiline_string_before.ml sample_files/multiline_string_after.ml
368850e1e2c9ba6c8bf0b025839769c5 -
sample_files/nest_before.rs sample_files/nest_after.rs
c36f2f545abee17589e2c18693ad5793 -

@ -0,0 +1,6 @@
let x =
"
foo
novel
"

@ -0,0 +1,6 @@
let x =
"
foo
bar
"

@ -737,8 +737,8 @@ impl MatchedPos {
// Don't create a MatchedPos for empty positions. This
// occurs when we have lists with empty open/close
// delimiter positions, such as the top-level list of syntax items.
if line_pos.start_col == line_pos.end_col {
continue;
if pos.len() == 1 && line_pos.start_col == line_pos.end_col {
break;
}
res.push(Self {