ZIm/crates/editor/src
vipex 12bc8907d9
Recall empty, unsaved buffers on app load (#33475)
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>
2025-07-11 22:23:04 +00:00
..
display_map Fix panic on inlay split (#33676) 2025-07-03 20:48:51 +00:00
git Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
scroll Reduce number of snapshots and notifies during editor scrolling (#34228) 2025-07-11 17:34:45 +00:00
test Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
actions.rs editor: Add action to sort lines by length (#33622) 2025-07-07 11:02:35 -06:00
blink_manager.rs Remove unneeded anonymous lifetimes from gpui::Context (#27686) 2025-03-28 19:26:30 +00:00
clangd_ext.rs Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
code_completion_tests.rs editor: Utilize filter_text from language server for filter_range (#33155) 2025-06-21 19:47:16 +05:30
code_context_menus.rs debugger: Improve debug console autocompletions (#33868) 2025-07-05 16:20:41 +02:00
display_map.rs Improve terminal rendering performance (#33345) 2025-07-08 09:05:01 -06:00
editor.rs Tinker with the reporting of telemetry events (#34239) 2025-07-11 12:02:40 -07:00
editor_settings.rs editor: Change drag_and_drop_selection cursor on delay elapsed + Add drag_and_drop_selection delay setting (#33928) 2025-07-09 12:38:23 +05:30
editor_settings_controls.rs Migrate to schemars version 1.0 (#33635) 2025-06-30 21:07:28 +00:00
editor_tests.rs editor: Fix block comment with same prefix as line comment incorrectly extending on new line (#34156) 2025-07-10 02:54:05 +05:30
element.rs Reduce number of snapshots and notifies during editor scrolling (#34228) 2025-07-11 17:34:45 +00:00
git.rs Project Diff 2 (#23891) 2025-02-03 13:18:50 -07:00
highlight_matching_bracket.rs debugger: Parse and highlight text with ANSI escape sequences (#32915) 2025-06-17 23:39:31 -04:00
hover_links.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
hover_popover.rs editor: Fix diagnostic popovers not being scrollable (#33581) 2025-07-08 16:14:22 +03:00
indent_guides.rs Fix editor rendering slowness with large folds (#31569) 2025-05-28 23:05:06 +00:00
inlay_hint_cache.rs Fix document colors issues with other inlays and multi buffers (#33598) 2025-06-28 21:10:49 +00:00
inline_completion_tests.rs Restore scroll after undo edit prediction (#31162) 2025-05-22 09:16:11 +00:00
items.rs Recall empty, unsaved buffers on app load (#33475) 2025-07-11 22:23:04 +00:00
jsx_tag_auto_close.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
linked_editing_ranges.rs editor: Fix extra characters were being written at the end of an HTML tag (#28529) 2025-04-11 00:17:34 +05:30
lsp_colors.rs Further improve color inlay hints in multi buffers (#33642) 2025-06-30 09:18:43 +00:00
lsp_ext.rs Select applicable positions for lsp_ext methods more leniently (#32272) 2025-06-06 22:47:20 +00:00
mouse_context_menu.rs keymap_ui: Add context menu for table rows (#33747) 2025-07-02 03:06:45 +00:00
movement.rs Cleanup handling of surrounding word logic, fixing crash in editor::SelectAllMatches (#33353) 2025-06-24 23:18:35 -06:00
persistence.rs Simplify the SerializableItem::cleanup implementation (#29567) 2025-04-28 22:15:24 +00:00
proposed_changes_editor.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
rust_analyzer_ext.rs Select applicable positions for lsp_ext methods more leniently (#32272) 2025-06-06 22:47:20 +00:00
scroll.rs Reduce number of snapshots and notifies during editor scrolling (#34228) 2025-07-11 17:34:45 +00:00
selections_collection.rs Fix panic when editor::OpenSelectionsInMultibuffer only has pending selection (#32842) 2025-06-17 08:35:14 +00:00
signature_help.rs lsp: Complete overloaded signature help implementation (#33199) 2025-07-02 20:51:08 +03:00
tasks.rs Support tasks from rust-analyzer (#28359) 2025-04-08 15:07:56 -06:00
test.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00