Skip to content

Commit

Permalink
Improve reliability of updating status bar panels (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjsjohnmurray authored Jul 26, 2024
1 parent 4925cd7 commit 5e68695
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1) {
const workspaceFolder = currentWorkspaceFolder();
if (workspaceFolder && workspaceFolder !== workspaceState.get<string>("workspaceFolder")) {
workspaceState.update("workspaceFolder", workspaceFolder);
await workspaceState.update("workspaceFolder", workspaceFolder);
await checkConnection(false, editor?.document.uri);
}
}
Expand Down Expand Up @@ -1318,15 +1318,20 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
}),
vscode.window.onDidChangeActiveTextEditor(async (textEditor: vscode.TextEditor) => {
if (!textEditor) return;
await checkConnection(false, textEditor.document.uri);
posPanel.text = "";
await checkConnection(false, textEditor.document.uri);
if (textEditor.document.uri.path.toLowerCase().endsWith(".xml") && config("autoPreviewXML")) {
return previewXMLAsUDL(textEditor, true);
}
}),
vscode.window.onDidChangeTextEditorSelection((event: vscode.TextEditorSelectionChangeEvent) => {
posPanel.text = "";
const document = event.textEditor.document;

// Avoid losing position indicator if event came from output channel
if (document.uri.scheme == "output") {
return;
}
posPanel.text = "";
if (![macLangId, intLangId].includes(document.languageId)) {
return;
}
Expand Down

0 comments on commit 5e68695

Please sign in to comment.