Skip to content

Commit 5e68695

Browse files
Improve reliability of updating status bar panels (#1416)
1 parent 4925cd7 commit 5e68695

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/extension.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
865865
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1) {
866866
const workspaceFolder = currentWorkspaceFolder();
867867
if (workspaceFolder && workspaceFolder !== workspaceState.get<string>("workspaceFolder")) {
868-
workspaceState.update("workspaceFolder", workspaceFolder);
868+
await workspaceState.update("workspaceFolder", workspaceFolder);
869869
await checkConnection(false, editor?.document.uri);
870870
}
871871
}
@@ -1318,15 +1318,20 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
13181318
}),
13191319
vscode.window.onDidChangeActiveTextEditor(async (textEditor: vscode.TextEditor) => {
13201320
if (!textEditor) return;
1321-
await checkConnection(false, textEditor.document.uri);
13221321
posPanel.text = "";
1322+
await checkConnection(false, textEditor.document.uri);
13231323
if (textEditor.document.uri.path.toLowerCase().endsWith(".xml") && config("autoPreviewXML")) {
13241324
return previewXMLAsUDL(textEditor, true);
13251325
}
13261326
}),
13271327
vscode.window.onDidChangeTextEditorSelection((event: vscode.TextEditorSelectionChangeEvent) => {
1328-
posPanel.text = "";
13291328
const document = event.textEditor.document;
1329+
1330+
// Avoid losing position indicator if event came from output channel
1331+
if (document.uri.scheme == "output") {
1332+
return;
1333+
}
1334+
posPanel.text = "";
13301335
if (![macLangId, intLangId].includes(document.languageId)) {
13311336
return;
13321337
}

0 commit comments

Comments
 (0)