Skip to content

Commit c00fe93

Browse files
committed
Avoids focusing view on find
1 parent ef71c18 commit c00fe93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/views/viewBase.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export abstract class ViewBase<
370370
if (this.root != null) return find.call(this);
371371

372372
// If we have no root (e.g. never been initialized) force it so the tree will load properly
373-
await this.show();
373+
await this.show({ preserveFocus: true });
374374
// Since we have to show the view, let the callstack unwind before we try to find the node
375375
return new Promise<ViewNode | undefined>(resolve => setTimeout(() => resolve(find.call(this)), 0));
376376
}
@@ -522,9 +522,9 @@ export abstract class ViewBase<
522522
}
523523

524524
@log()
525-
async show() {
525+
async show(options?: { preserveFocus?: boolean }) {
526526
try {
527-
void (await commands.executeCommand(`${this.id}.focus`));
527+
void (await commands.executeCommand(`${this.id}.focus`, options));
528528
} catch (ex) {
529529
Logger.error(ex);
530530
}

0 commit comments

Comments
 (0)