From 4fb628975c41cd1a38f2eb1a53993d4368d7b2f6 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 5 Mar 2023 21:07:54 -0600 Subject: [PATCH] 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 --- src/interface/obsidian/src/modal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/obsidian/src/modal.ts b/src/interface/obsidian/src/modal.ts index 19f17f40..bf9ad7b7 100644 --- a/src/interface/obsidian/src/modal.ts +++ b/src/interface/obsidian/src/modal.ts @@ -109,7 +109,7 @@ export class KhojModal extends SuggestModal { .sort((a, b) => b.path.length - a.path.length) // The first match is the best file match across OS // e.g Khoj server on Linux, Obsidian vault on Android - .find(file => result.file.endsWith(file.path)) + .find(file => result.file.replace(/\\/g, "/").endsWith(file.path)) // Open vault file at heading of chosen search result if (file_match) {