Reveal panel on navigate, to prevent webview destruction

This commit is contained in:
Asger F
2022-10-19 14:09:38 +02:00
parent d08e005b46
commit 45b6288363

View File

@@ -176,6 +176,11 @@ export class ResultsView extends AbstractWebview<IntoResultsViewMsg, FromResults
}
async navigateResultView(direction: NavigationDirection): Promise<void> {
if (!this.panel?.visible) {
return;
}
// Reveal the panel now as the subsequent call to 'Window.showTextEditor' in 'showLocation' may destroy the webview otherwise.
this.panel.reveal();
await this.postMessage({ t: 'navigate', direction });
}