Skip to content

Commit ad6d175

Browse files
committed
Fixes microsoft#25221: Render line highlights for all cursors
1 parent 5b70b99 commit ad6d175

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
1414
import { Selection } from 'vs/editor/common/core/selection';
1515
import { EditorOption } from 'vs/editor/common/config/editorOptions';
1616

17-
let isRenderedUsingBorder = true;
18-
1917
export abstract class AbstractLineHighlightOverlay extends DynamicViewOverlay {
2018
private readonly _context: ViewContext;
2119
protected _lineHeight: number;
@@ -57,17 +55,14 @@ export abstract class AbstractLineHighlightOverlay extends DynamicViewOverlay {
5755
private _readFromSelections(): boolean {
5856
let hasChanged = false;
5957

60-
// Only render the first selection when using border
61-
const renderSelections = isRenderedUsingBorder ? this._selections.slice(0, 1) : this._selections;
62-
63-
const cursorsLineNumbers = renderSelections.map(s => s.positionLineNumber);
58+
const cursorsLineNumbers = this._selections.map(s => s.positionLineNumber);
6459
cursorsLineNumbers.sort((a, b) => a - b);
6560
if (!arrays.equals(this._cursorLineNumbers, cursorsLineNumbers)) {
6661
this._cursorLineNumbers = cursorsLineNumbers;
6762
hasChanged = true;
6863
}
6964

70-
const selectionIsEmpty = renderSelections.every(s => s.isEmpty());
65+
const selectionIsEmpty = this._selections.every(s => s.isEmpty());
7166
if (this._selectionIsEmpty !== selectionIsEmpty) {
7267
this._selectionIsEmpty = selectionIsEmpty;
7368
hasChanged = true;
@@ -203,7 +198,6 @@ export class CurrentLineMarginHighlightOverlay extends AbstractLineHighlightOver
203198
}
204199

205200
registerThemingParticipant((theme, collector) => {
206-
isRenderedUsingBorder = false;
207201
const lineHighlight = theme.getColor(editorLineHighlight);
208202
if (lineHighlight) {
209203
collector.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${lineHighlight}; }`);
@@ -212,7 +206,6 @@ registerThemingParticipant((theme, collector) => {
212206
if (!lineHighlight || lineHighlight.isTransparent() || theme.defines(editorLineHighlightBorder)) {
213207
const lineHighlightBorder = theme.getColor(editorLineHighlightBorder);
214208
if (lineHighlightBorder) {
215-
isRenderedUsingBorder = true;
216209
collector.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${lineHighlightBorder}; }`);
217210
collector.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${lineHighlightBorder}; }`);
218211
if (theme.type === 'hc') {

0 commit comments

Comments
 (0)