obsidian-remember-cursor-position
obsidian-remember-cursor-position copied to clipboard
When same document is opened in multiple tabs and one tab is hidden, the other tab tries to restore the hidden tab scrolling position
So multi-tab of same document support is quite good when all the tabs are visible on different panes, but say I have multiple tabs on some of my panes like this:
- Left pane: document A (visible)
- Right pane: document A, document B (visible) When I switch focus form Right to Left pane, the document A on the right will auto-scroll to the last position on the hidden document A from the Right pane.
Repro:
- Create 2 dummy files A and B
- Open tabs following this config:
- Left pane: document A (visible)
- Right pane: document A (visible), document B
- In left pane doc A, scroll down to position X (you can keep it at the top)
- In right pane doc A, scroll down to position Y (you can also select some text to make the bug more obvious)
- In right pane, click on doc B to hide doc A. You now see A on the left at pos X, B on the right. Make sure right pane doc B is focused.
- Focus left pane Expected: left pane doc A preserves scrolling position X Actual: left pane doc A scrolls to position Y (and highlights text if we selected some in step 4)
As a comparison I tried https://github.com/ludovicchabant/obsidian-remember-file-state which used not to support multi-tabs well, but it now supports them including hidden tabs properly.