diff --git a/CHANGELOG.md b/CHANGELOG.md index 49b1dfa41..f2c1526f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## 0.37 (unreleased) +### Diffing + +Standalone `.` is now considered punctuation in the diff cost model, +which improves diff results in some cases. + ### Build Fixed an issue with building on Windows with gcc. diff --git a/src/diff/graph.rs b/src/diff/graph.rs index f3fc42364..db00be25c 100644 --- a/src/diff/graph.rs +++ b/src/diff/graph.rs @@ -414,7 +414,7 @@ fn allocate_if_new<'syn, 'b>( /// This check is deliberately conservative, becuase it's hard to /// accurately recognise punctuation in a language-agnostic way. fn looks_like_punctuation(content: &str) -> bool { - content == "," || content == ";" + content == "," || content == ";" || content == "." } /// Compute the neighbours of `v` if we haven't previously done so,