Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reliability of updating status bar panels #1416

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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