Skip to content

Commit

Permalink
fix: Fix first letter of suggest modal being cut off
Browse files Browse the repository at this point in the history
Merge pull request #1454 from Erallie/master
Fix first letter of suggest modal being cut off
refs: #1436
  • Loading branch information
Zachatoo authored Sep 12, 2024
2 parents 72f4161 + 6d30f8f commit 0f07a0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handlers/FuzzySuggester.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FuzzySuggestModal, TFile, TFolder } from "obsidian";
import { FuzzySuggestModal, TFile, TFolder, normalizePath } from "obsidian";
import { get_tfiles_from_folder } from "utils/Utils";
import TemplaterPlugin from "main";
import { errorWrapperSync } from "utils/Error";
Expand Down Expand Up @@ -36,7 +36,7 @@ export class FuzzySuggester extends FuzzySuggestModal<TFile> {

getItemText(item: TFile): string {
let relativePath = item.path;
if (item.path.startsWith(this.plugin.settings.templates_folder)) {
if (item.path.startsWith(this.plugin.settings.templates_folder) && normalizePath(this.plugin.settings.templates_folder) != '/') {
relativePath = item.path.slice(
this.plugin.settings.templates_folder.length + 1
);
Expand Down

0 comments on commit 0f07a0d

Please sign in to comment.