mirror of
https://github.com/dragonish/obsidian-heading-decorator.git
synced 2026-07-22 05:42:05 +00:00
perf(folder): optimize folder suggestion performance
This commit is contained in:
parent
cad88cec47
commit
e2cc16f2c4
1 changed files with 2 additions and 1 deletions
|
|
@ -10,9 +10,10 @@ export class FolderSuggest extends AbstractInputSuggest<string> {
|
|||
|
||||
getSuggestions(query: string): string[] {
|
||||
const folders = this.app.vault.getAllFolders();
|
||||
const queryLower = query.toLowerCase();
|
||||
return folders
|
||||
.map((folder) => folder.path)
|
||||
.filter((path) => path.toLowerCase().includes(query.toLowerCase()));
|
||||
.filter((path) => path.toLowerCase().includes(queryLower));
|
||||
}
|
||||
|
||||
renderSuggestion(value: string, el: HTMLElement) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue