Skip to content

Commit

Permalink
feat: Return Relative Paths of Templates in Fuzzy Suggester Prompt
Browse files Browse the repository at this point in the history
Merge pull request #1418 from itsonlyjames/master
Return Relative Paths of Templates in Fuzzy Suggester Prompt
refs: #1418
  • Loading branch information
Zachatoo authored Jul 24, 2024
2 parents fb20287 + 72645d2 commit 4910143
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/handlers/FuzzySuggester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ export class FuzzySuggester extends FuzzySuggestModal<TFile> {
}

getItemText(item: TFile): string {
return item.basename;
let relativePath = item.path;
if (item.path.startsWith(this.plugin.settings.templates_folder)) {
relativePath = item.path.slice(
this.plugin.settings.templates_folder.length + 1
);
}
return relativePath.split(".").slice(0, -1).join(".");
}

onChooseItem(item: TFile): void {
Expand Down

0 comments on commit 4910143

Please sign in to comment.