Active leaf is saved but not restored

Steps to reproduce

  1. Create a multi-pane layout, and activate any pane other than the first.
  2. Save the workspace, using either the workspace plugin, or by exiting Obsidian
  3. Restore the workspace, either using the workspace plugin or re-opening Obsidian

Expected result

The pane activated in step 1 should be active

Actual result

The first pane is active instead

Environment

  • Operating system: Windows
  • Obsidian version: 0.11.9

Additional information

When the layout is being deserialized, the “active” leaf is passed to setActiveLeaf(), but is immediately rejected because the workspace’s rootSplit is null. A possible fix would be to add an option to deserializeLayout() to tell it to set the root split to the split it’s creating, before it deserializes any of the contents. (Or perhaps changing setActiveLeaf() to accept setting the active leaf when rootSplit is null.)

For the convenience of anybody else experiencing this issue, I’ve added a workaround to version 0.0.2 of the Pane Relief plugin. (It makes the new “save and load workspace” command a lot more useful!)

Good catch, this must have been broken for a long time; I remember implementing it a looong time ago…

fixed in 0.11.11

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.