fix: scroll to note preview

fix: #996
This commit is contained in:
windingwind 2024-06-03 19:05:24 +08:00
parent 0e88d52e96
commit 68d88751e4

View File

@ -140,6 +140,9 @@ function scrollPreviewEditorTo(
`note-editor[data-id="${item.id}"]`,
) as EditorElement;
if (!editor) return;
const section = editor.closest("item-pane-custom-section");
// @ts-ignore
workspace?.querySelector("bn-details")?.scrollToPane(section.dataset.pane);
if (typeof options.lineIndex === "number") {
addon.api.editor.scroll(editor._editorInstance, options.lineIndex);
}