Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6e07398

Browse files
committedFeb 6, 2025·
add event handler for active text editor changes
1 parent 5c1ed38 commit 6e07398

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/documentation/DocumentationPreviewEditor.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export class DocumentationPreviewEditor implements vscode.Disposable {
110110
this.activeTextEditor = vscode.window.activeTextEditor;
111111
this.subscriptions.push(
112112
this.webviewPanel.webview.onDidReceiveMessage(this.receiveMessage, this),
113+
vscode.window.onDidChangeActiveTextEditor(this.handleActiveTextEditorChange, this),
113114
vscode.window.onDidChangeTextEditorSelection(
114115
this.handleTextEditorSelectionChange,
115116
this
@@ -166,6 +167,14 @@ export class DocumentationPreviewEditor implements vscode.Disposable {
166167
}
167168
}
168169

170+
private handleActiveTextEditorChange(textEditor: vscode.TextEditor | undefined) {
171+
if (textEditor === undefined) {
172+
return;
173+
}
174+
this.activeTextEditor = textEditor;
175+
this.convertDocumentation(textEditor);
176+
}
177+
169178
private handleTextEditorSelectionChange(event: vscode.TextEditorSelectionChangeEvent) {
170179
if (event.textEditor === undefined) {
171180
return;

0 commit comments

Comments
 (0)
Please sign in to comment.