Skip to content

Commit

Permalink
feat(folder): handle trailing slash in the folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
Venkatraman D committed Sep 16, 2024
1 parent deba391 commit 9eac995
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SnippetManagerSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default class SnippetManagerSettingTab extends PluginSettingTab {
.setPlaceholder('Snippets.md')
.setValue(this.plugin.settings.snippetPath)
.onChange(async (value) => {
// Remove trailing slash if it exists
if (value.endsWith('/')) {
value = value.slice(0, -1);
}
this.plugin.settings.snippetPath = value;
await this.plugin.saveSettings();
this.plugin.clearSnippets();
Expand Down

0 comments on commit 9eac995

Please sign in to comment.