Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes merge editor bug #167113

Merged
merged 1 commit into from Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/vs/editor/test/node/diffing/fixtures/equals/1.txt
@@ -0,0 +1,2 @@
hello
world
2 changes: 2 additions & 0 deletions src/vs/editor/test/node/diffing/fixtures/equals/2.txt
@@ -0,0 +1,2 @@
hello
world
@@ -0,0 +1,5 @@
{
"originalFileName": "./1.txt",
"modifiedFileName": "./2.txt",
"diffs": []
}
@@ -0,0 +1,5 @@
{
"originalFileName": "./1.txt",
"modifiedFileName": "./2.txt",
"diffs": []
}
Expand Up @@ -63,13 +63,13 @@ export class MergeDiffComputer implements IMergeDiffComputer {
);

assertFn(() => {
return changes[0].inputRange.startLineNumber === changes[0].outputRange.startLineNumber &&
return changes.length === 0 || (changes[0].inputRange.startLineNumber === changes[0].outputRange.startLineNumber &&
checkAdjacentItems(changes,
(m1, m2) => m2.inputRange.startLineNumber - m1.inputRange.endLineNumberExclusive === m2.outputRange.startLineNumber - m1.outputRange.endLineNumberExclusive &&
// There has to be an unchanged line in between (otherwise both diffs should have been joined)
m1.inputRange.endLineNumberExclusive < m2.inputRange.startLineNumber &&
m1.outputRange.endLineNumberExclusive < m2.outputRange.startLineNumber,
);
));
});

return {
Expand Down