mirror of
https://gitlab.com/ArkHost/HelixNotes.git
synced 2026-07-23 23:35:57 +02:00
Fix 'Open in New Window' cursor jumping to the top when pausing (ignore the file-watcher echo of the window's own save)
This commit is contained in:
@@ -2660,6 +2660,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
// The markdown body the editor would currently save; used to ignore the file-watcher echo of our own save.
|
||||
export function getCurrentBody(): string {
|
||||
return $sourceMode ? restoreTitleH1(sourceContent) : editorToMarkdown();
|
||||
}
|
||||
|
||||
// ── Tag editing (active note) ──
|
||||
function toggleTagMenu(e: MouseEvent) {
|
||||
if (tagMenu) { tagMenu = null; return; }
|
||||
|
||||
@@ -103,8 +103,11 @@
|
||||
if (!$editorDirty) {
|
||||
try {
|
||||
const content = await readNote(notePath);
|
||||
// Ignore the file-watcher echo of our own save; only reload genuine external edits.
|
||||
if (content.content.trim() !== (editor?.getCurrentBody() ?? '').trim()) {
|
||||
$activeNote = content;
|
||||
editor?.loadNote(notePath, content.content);
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user