Skip to content

Commit c3c62cb

Browse files
committed
Fixes scroll synchronization bug.
1 parent d21ab95 commit c3c62cb

File tree

1 file changed

+10
-8
lines changed
  • src/vs/workbench/contrib/mergeEditor/browser/model

1 file changed

+10
-8
lines changed

src/vs/workbench/contrib/mergeEditor/browser/model/mapping.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,17 @@ export class DocumentMapping {
162162
if (lastBefore.getRange(containingDirection).contains(lineNumber)) {
163163
return lastBefore;
164164
}
165-
return new LineRangeMapping(
166-
new LineRange(lineNumber, 1),
167-
new LineRange(
168-
lineNumber +
169-
lastBefore.getRange(mapTo).endLineNumberExclusive -
170-
lastBefore.getRange(containingDirection).endLineNumberExclusive,
171-
1
172-
)
165+
const containingRange = new LineRange(lineNumber, 1);
166+
const mappedRange = new LineRange(
167+
lineNumber +
168+
lastBefore.getRange(mapTo).endLineNumberExclusive -
169+
lastBefore.getRange(containingDirection).endLineNumberExclusive,
170+
1
173171
);
172+
173+
return containingDirection === MappingDirection.input
174+
? new LineRangeMapping(containingRange, mappedRange)
175+
: new LineRangeMapping(mappedRange, containingRange);
174176
}
175177
return new LineRangeMapping(
176178
new LineRange(lineNumber, 1),

0 commit comments

Comments
 (0)