From c00fe93fd3d1fdd0445a8d08c26b08a8f5cba103 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 18 Nov 2021 02:27:39 -0500 Subject: [PATCH] Avoids focusing view on find --- src/views/viewBase.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/viewBase.ts b/src/views/viewBase.ts index 05408ac2cfd13..67667d8699e3b 100644 --- a/src/views/viewBase.ts +++ b/src/views/viewBase.ts @@ -370,7 +370,7 @@ export abstract class ViewBase< if (this.root != null) return find.call(this); // If we have no root (e.g. never been initialized) force it so the tree will load properly - await this.show(); + await this.show({ preserveFocus: true }); // Since we have to show the view, let the callstack unwind before we try to find the node return new Promise(resolve => setTimeout(() => resolve(find.call(this)), 0)); } @@ -522,9 +522,9 @@ export abstract class ViewBase< } @log() - async show() { + async show(options?: { preserveFocus?: boolean }) { try { - void (await commands.executeCommand(`${this.id}.focus`)); + void (await commands.executeCommand(`${this.id}.focus`, options)); } catch (ex) { Logger.error(ex); }