More rigorous set layout state sanity check

This commit is contained in:
Kovid Goyal 2025-08-02 12:48:04 +05:30
parent c4ed1d3b69
commit bbbeeb8206
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -713,7 +713,8 @@ class Splits(Layout):
def set_layout_state(self, layout_state: dict[str, Any], map_window_id: WindowMapper) -> bool:
new_root = Pair()
new_root.unserialize(layout_state['pairs'], map_window_id)
if new_root.one or new_root.two:
before = frozenset(self.pairs_root.all_window_ids())
if before == frozenset(new_root.all_window_ids()):
self.pairs_root = new_root
self.layout_opts = SplitsLayoutOpts(layout_state['opts'])
return True