Skip to content

Commit

Permalink
Improve quit flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jul 11, 2023
1 parent 953bd52 commit 66998c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions denops/ddu/ddu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export class Ddu {
return;
}
await this.uiQuit(denops, ui, uiOptions, uiParams);
this.quit();
}

const checkToggle = this.initialized && !this.shouldStopCurrentContext() &&
Expand Down Expand Up @@ -159,8 +160,8 @@ export class Ddu {
}

if (checkToggle && uiOptions.toggle) {
this.quit();
await this.uiQuit(denops, ui, uiOptions, uiParams);
this.quit();
return;
}

Expand Down Expand Up @@ -206,8 +207,8 @@ export class Ddu {
return;
}
if (checkToggle && uiOptions.toggle) {
this.quit();
await this.uiQuit(denops, ui, uiOptions, uiParams);
this.quit();
return;
}

Expand Down Expand Up @@ -254,8 +255,8 @@ export class Ddu {
if (!ui) {
return;
}
this.quit();
await this.uiQuit(denops, ui, uiOptions, uiParams);
this.quit();

// Disable resume
userOptions.resume = false;
Expand Down Expand Up @@ -684,6 +685,7 @@ export class Ddu {
}

quit() {
// NOTE: quitted flag must be called after uiQuit().
this.quitted = true;
}

Expand Down

0 comments on commit 66998c4

Please sign in to comment.