Skip to content

Commit

Permalink
Fix roundedSelection when line rendering is mixed
Browse files Browse the repository at this point in the history
Fixes #233797
  • Loading branch information
Tyriar committed Nov 15, 2024
1 parent 2fc0143 commit 6df9a97
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/vs/editor/browser/view/renderingContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,13 @@ export class RenderingContext extends RestrictedRenderingContext {
return domRanges ?? null;
}
const gpuRanges = this._viewLinesGpu.linesVisibleRangesForRange(range, includeNewLines);
if (!domRanges && !gpuRanges) {
return null;
}
const ranges = [];
if (domRanges) {
ranges.push(...domRanges);
if (!domRanges) {
return gpuRanges;
}
if (gpuRanges) {
ranges.push(...gpuRanges);
if (!gpuRanges) {
return domRanges;
}
return ranges;
return domRanges.concat(gpuRanges).sort((a, b) => a.lineNumber - b.lineNumber);
}

public visibleRangeForPosition(position: Position): HorizontalPosition | null {
Expand Down

0 comments on commit 6df9a97

Please sign in to comment.