obsidian-remember-cursor-position icon indicating copy to clipboard operation
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

Open hsandt opened this issue 2 years ago • 0 comments

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:

  1. Create 2 dummy files A and B
  2. Open tabs following this config:
  • Left pane: document A (visible)
  • Right pane: document A (visible), document B
  1. In left pane doc A, scroll down to position X (you can keep it at the top)
  2. In right pane doc A, scroll down to position Y (you can also select some text to make the bug more obvious)
  3. 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.
  4. 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.

hsandt avatar Oct 17 '23 13:10 hsandt