Skip to content

Commit ec32112

Browse files
committed
Fix Obsidian Advanced URI support for Recent mode
1 parent e980568 commit ec32112

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ObsidianShell/Obsidian.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ private static string PercentEncode(string text)
6363
return Uri.EscapeDataString(text);
6464
}
6565

66-
private void OpenFileInVault(string path)
66+
private void OpenFileInVault(string path, string vaultPath = null)
6767
{
6868
if (_settings.EnableAdvancedURI is false)
6969
{
7070
Process.Start($"obsidian://open?path={PercentEncode(path)}");
7171
}
7272
else
7373
{
74-
string vaultPath = GetFileVaultPath(path);
74+
vaultPath = vaultPath ?? GetFileVaultPath(path);
7575
string vault = GetVaultName(vaultPath);
7676
string filename = Utils.GetRelativePath(vaultPath, path);
7777

@@ -177,7 +177,7 @@ private void OpenFileInRecent(string path)
177177
path_in_recent = CreateLinkInRecent(directory.Parent, false) + '\\' + directory.Name;
178178
}
179179

180-
OpenFileInVault(path_in_recent);
180+
OpenFileInVault(path_in_recent, _settings.RecentVault);
181181
}
182182

183183
private static string FormatLinkName(string prefixed_name, bool explicitDirectory)

0 commit comments

Comments
 (0)