Преглед изворни кода

Avoids focusing view on find

main
Eric Amodio пре 3 година
родитељ
комит
c00fe93fd3
1 измењених фајлова са 3 додато и 3 уклоњено
  1. +3
    -3
      src/views/viewBase.ts

+ 3
- 3
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<ViewNode | undefined>(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);
}

Loading…
Откажи
Сачувај