Skip to content

Commit

Permalink
Fix the "Prevent the suggestion box from closing" setting not working
Browse files Browse the repository at this point in the history
  • Loading branch information
RyotaUshio committed Dec 7, 2023
1 parent 745eb59 commit db9ee49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class EnhancedLinkSuggestionsPlugin extends Plugin {
await this.loadSettings();
await this.saveSettings();
this.addSettingTab(new EnhancedLinkSuggestionsSettingTab(this));
this.app.workspace.onLayoutReady(() => this.patchRenderSuggestion());
this.app.workspace.onLayoutReady(() => this.patchBuiltInSuggest());
}

async loadSettings() {
Expand All @@ -29,7 +29,7 @@ export default class EnhancedLinkSuggestionsPlugin extends Plugin {
return this.app.workspace.editorSuggest.suggests[0];
}

patchRenderSuggestion() {
patchBuiltInSuggest() {
const suggest = this.getBuiltInSuggest();
const plugin = this;
const app = this.app;
Expand Down Expand Up @@ -66,6 +66,12 @@ export default class EnhancedLinkSuggestionsPlugin extends Plugin {
});
}
}
},
close(old) {
return function () {
if (plugin.settings.disableClose) return;
old.call(this);
}
}
}));
}
Expand Down

0 comments on commit db9ee49

Please sign in to comment.