Skip to content

Commit 45b6288

Browse files
committed
Reveal panel on navigate, to prevent webview destruction
1 parent d08e005 commit 45b6288

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

extensions/ql-vscode/src/interface.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
176176
}
177177

178178
async navigateResultView(direction: NavigationDirection): Promise<void> {
179+
if (!this.panel?.visible) {
180+
return;
181+
}
182+
// Reveal the panel now as the subsequent call to 'Window.showTextEditor' in 'showLocation' may destroy the webview otherwise.
183+
this.panel.reveal();
179184
await this.postMessage({ t: 'navigate', direction });
180185
}
181186

0 commit comments

Comments
 (0)