Skip to content

Commit 4fb6289

Browse files
committed
Fix jumping to note from Khoj Obsidian search modal result on Windows
- Issue The file path separator by khoj server and the Obsidian vault were different on Windows - Fix Normalize file path to use forward slash(/) to find the matching note file in the Obsidian vault for jump to it Resolves #177
1 parent 7184508 commit 4fb6289

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interface/obsidian/src/modal.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class KhojModal extends SuggestModal<SearchResult> {
109109
.sort((a, b) => b.path.length - a.path.length)
110110
// The first match is the best file match across OS
111111
// e.g Khoj server on Linux, Obsidian vault on Android
112-
.find(file => result.file.endsWith(file.path))
112+
.find(file => result.file.replace(/\\/g, "/").endsWith(file.path))
113113

114114
// Open vault file at heading of chosen search result
115115
if (file_match) {

0 commit comments

Comments
 (0)