From 207cd570e80cc731cd84a091e05cac574841f18d Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 8 Dec 2023 14:23:05 +0100 Subject: [PATCH] fix: scroll to cursor when opening --- main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 389dfc1..78ff53e 100644 --- a/main.js +++ b/main.js @@ -2968,13 +2968,14 @@ function bindfile(note) } resize(); - // to improve... + setpos(note.pos || 0); + if (!issplit() && searchdialog.hidden) { + // force to scroll to cursor pos + md.blur(); md.focus(); } - - setpos(note.pos || 0); } function defaultheaders(tags = "")