mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-24 01:20:29 +01:00
12bc8907d9
Closes #33342 This PR implements serialization of pinned tabs regardless of their state (empty, untitled, etc.) The root cause was that empty untitled tabs were being skipped during serialization but their pinned state was still being persisted, leading to a mismatch between the stored pinned count and actual restorable tabs, this issue lead to a crash which was patched by @JosephTLyons, but this PR aims to be a proper fix. **Note**: I'm still evaluating the best approach for this fix. Currently exploring whether it's necessary to store the pinned state in the database schema or if there's a simpler solution that doesn't require schema changes. --- **Edit from Joseph** We ended up going with altering our recall logic, where we always restore all editors, even those that are new, empty, and unsaved. This prevents the crash that #33335 patched because we are no longer skipping the restoration of pinned editors that have no text and haven't been saved, throwing off the count dealing with the number of pinned items. This solution is rather simple, but I think it's fine. We simply just restore everything the same, no conditional dropping of anything. This is also consistent with VS Code, which also restores all editors, regardless of whether or not a new, unsaved buffers have content or not. https://github.com/zed-industries/zed/tree/alt-solution-for-%2333342 Release Notes: - N/A --------- Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>