Skip to content

Commit

Permalink
feat: open not supported files in changed files modal in default app
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Mar 27, 2021
1 parent 95cb53d commit 93930e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ class ChangedFilesModal extends FuzzySuggestModal<FileStatusResult> {
super(plugin.app);
this.plugin = plugin;
this.changedFiles = changedFiles;
this.setPlaceholder("Only files in vault can be openend!");
this.setPlaceholder("Not supported files will be opened by default app!");
}

getItems(): FileStatusResult[] {
Expand All @@ -766,7 +766,7 @@ class ChangedFilesModal extends FuzzySuggestModal<FileStatusResult> {

onChooseItem(item: FileStatusResult, _: MouseEvent | KeyboardEvent): void {
if (this.plugin.app.metadataCache.getFirstLinkpathDest(item.path, "") == null) {
new Notice("Can't open file in Obsidian");
(this.app as any).openWithDefaultApp(item.path);
} else {
this.plugin.app.workspace.openLinkText(item.path, "/");
}
Expand Down

0 comments on commit 93930e0

Please sign in to comment.