Persist editor folds between restarts (#27252)
Part of https://github.com/zed-industries/zed/issues/11626 https://github.com/user-attachments/assets/276cca5f-dd87-4496-b1b8-40b211f65aa7 Folds restoration between editor reopens will follow later Release Notes: - Started to persist editor folds between restarts
This commit is contained in:
parent
93bd32b425
commit
6397872c49
3 changed files with 173 additions and 35 deletions
|
@ -1078,8 +1078,7 @@ impl SerializableItem for Editor {
|
|||
cx.new(|cx| {
|
||||
let mut editor = Editor::for_buffer(buffer, Some(project), window, cx);
|
||||
|
||||
editor.read_selections_from_db(item_id, workspace_id, window, cx);
|
||||
editor.read_scroll_position_from_db(item_id, workspace_id, window, cx);
|
||||
editor.read_metadata_from_db(item_id, workspace_id, window, cx);
|
||||
editor
|
||||
})
|
||||
})
|
||||
|
@ -1137,18 +1136,7 @@ impl SerializableItem for Editor {
|
|||
let mut editor =
|
||||
Editor::for_buffer(buffer, Some(project), window, cx);
|
||||
|
||||
editor.read_selections_from_db(
|
||||
item_id,
|
||||
workspace_id,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
editor.read_scroll_position_from_db(
|
||||
item_id,
|
||||
workspace_id,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
editor.read_metadata_from_db(item_id, workspace_id, window, cx);
|
||||
editor
|
||||
})
|
||||
})
|
||||
|
@ -1169,8 +1157,7 @@ impl SerializableItem for Editor {
|
|||
window.spawn(cx, async move |cx| {
|
||||
let editor = open_by_abs_path?.await?.downcast::<Editor>().with_context(|| format!("Failed to downcast to Editor after opening abs path {abs_path:?}"))?;
|
||||
editor.update_in(cx, |editor, window, cx| {
|
||||
editor.read_selections_from_db(item_id, workspace_id, window, cx);
|
||||
editor.read_scroll_position_from_db(item_id, workspace_id, window, cx);
|
||||
editor.read_metadata_from_db(item_id, workspace_id, window, cx);
|
||||
})?;
|
||||
Ok(editor)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue