You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remember position in document when switching between files/tabs #2672
When you switch between another open document via tabs and return to the previous document, the area you were viewing is reset to the location of the mouse cursor.
Steps to reproduce
Open document A & B, each in their own tab.
Scroll halfway down document A, then switch to document B.
Return to document A to find the place in the document you were viewing, has been reset to the mouse cursor. This also affects the position of the Table of Contents.
Expected behavior:
Remember the position in the document where I was viewing. Notepad++ and VS Code do this by default, along with web browsers, word processors, etc.
Actual behavior:
Switching tabs resets the location to the mouse cursor. It also moves the Table of Contents which is annoying.
Thanks for the suggestion! This is now implemented in current MarkText: each open tab remembers its scroll position, and switching back to a tab restores where you were viewing (the restore even handles documents that haven't fully re-rendered yet, so it won't clamp to the top). You can see the save-on-scroll and restore-on-tab-switch logic in packages/desktop/src/renderer/src/components/editorWithTabs/editor.vue and the editor store. The active Table of Contents entry follows the restored scroll position as well. Closing as implemented, but if you still see the position reset on a recent build, please reopen with your version and a short repro and we'll take another look.
Activity
jhult commentedon Dec 5, 2023
It would be nice to have the scroll position saved when switching tabs.
Jocs commentedon Jul 2, 2026
Thanks for the suggestion! This is now implemented in current MarkText: each open tab remembers its scroll position, and switching back to a tab restores where you were viewing (the restore even handles documents that haven't fully re-rendered yet, so it won't clamp to the top). You can see the save-on-scroll and restore-on-tab-switch logic in packages/desktop/src/renderer/src/components/editorWithTabs/editor.vue and the editor store. The active Table of Contents entry follows the restored scroll position as well. Closing as implemented, but if you still see the position reset on a recent build, please reopen with your version and a short repro and we'll take another look.