Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Index restored editor selections and preserve their order (#65171)

Kirill Bulatov786be276c757
diff --git a/crates/editor/src/persistence.rs b/crates/editor/src/persistence.rs
index f1f12239cf1..692e6b6717f 100644
--- a/crates/editor/src/persistence.rs
+++ b/crates/editor/src/persistence.rs
@@ -223,6 +223,10 @@ impl Domain for EditorDb {
PRIMARY KEY(workspace_id, path, start)
);
),
+ sql!(
+ CREATE INDEX editor_selections_editor_id_workspace_id
+ ON editor_selections (editor_id, workspace_id);
+ ),
];
}
@@ -293,6 +297,7 @@ impl EditorDb {
SELECT start, end
FROM editor_selections
WHERE editor_id = ?1 AND workspace_id = ?2
+ ORDER BY item_id
}
}