mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Fix #173869 marking active line for code elements too in markdown preview
This commit is contained in:
@@ -9,7 +9,7 @@ export class ActiveLineMarker {
|
||||
|
||||
onDidChangeTextEditorSelection(line: number, documentVersion: number) {
|
||||
const { previous } = getElementsForSourceLine(line, documentVersion);
|
||||
this._update(previous && previous.element);
|
||||
this._update(previous && (previous.codeElement || previous.element));
|
||||
}
|
||||
|
||||
_update(before: HTMLElement | undefined) {
|
||||
@@ -22,13 +22,14 @@ export class ActiveLineMarker {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
element.className = element.className.replace(/\bcode-active-line\b/g, '');
|
||||
element.classList.toggle('code-active-line', false);
|
||||
}
|
||||
|
||||
_markActiveElement(element: HTMLElement | undefined) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
element.className += ' code-active-line';
|
||||
|
||||
element.classList.toggle('code-active-line', true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user