Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit a5fb9fc

Browse files
committed
Record the last active editor when the user changes editor tabs
1 parent 5103731 commit a5fb9fc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/extension.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,16 @@ export async function activate(context: vscode.ExtensionContext) {
318318
vscode.workspace.onDidChangeTextDocument(() => {
319319
recordLastActivity();
320320
});
321+
322+
323+
/**
324+
* Whenever the user switches to a different tab, we record the new active text editor,
325+
* so that Codiga Assistant preview/insert has a target editor to work with.
326+
*/
327+
vscode.window.onDidChangeActiveTextEditor(editor => {
328+
if (editor)
329+
recordLastEditor();
330+
});
321331
}
322332

323333
// this method is called when your extension is deactivated

0 commit comments

Comments
 (0)