mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Don't score whitespace matches
Co-Authored-By: Kyle Caverly <kyle@zed.dev>
This commit is contained in:
parent
e4f49746e1
commit
a69461dba2
@ -107,7 +107,11 @@ impl Diff {
|
||||
let insertion_score = self.scores.get(i, j - 1) + Self::INSERTION_SCORE;
|
||||
let deletion_score = self.scores.get(i - 1, j) + Self::DELETION_SCORE;
|
||||
let equality_score = if self.old[i - 1] == self.new[j - 1] {
|
||||
self.scores.get(i - 1, j - 1) + Self::EQUALITY_SCORE
|
||||
if self.old[i - 1] == ' ' {
|
||||
self.scores.get(i - 1, j - 1)
|
||||
} else {
|
||||
self.scores.get(i - 1, j - 1) + Self::EQUALITY_SCORE
|
||||
}
|
||||
} else {
|
||||
isize::MIN
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user