Fix worktree ordering with PathList (#39944)
The recent introduction of PathList removed some of the ordering logic resulting in paths always being alphabetised. This change restores the previous logic for sorting worktrees in a project using the newer PathList type. Closes #39934 Release Notes: - Fixed manual worktree reordering <details> <summary>Screen recording of it retaining the order</summary> https://github.com/user-attachments/assets/0197d118-6ea7-4d2d-8fec-c917fcb9d277 </details> --------- Co-authored-by: MrSubidubi <finn@zed.dev>
This commit is contained in:
co-authored by
MrSubidubi
parent
f6630ed736
commit
237474a889
@@ -1539,7 +1539,7 @@ impl Workspace {
|
||||
persistence::DB.workspace_for_roots(paths_to_open.as_slice());
|
||||
|
||||
if let Some(paths) = serialized_workspace.as_ref().map(|ws| &ws.paths) {
|
||||
paths_to_open = paths.paths().to_vec();
|
||||
paths_to_open = paths.ordered_paths().cloned().collect();
|
||||
if !paths.is_lexicographically_ordered() {
|
||||
project_handle
|
||||
.update(cx, |project, cx| {
|
||||
|
||||
Reference in New Issue
Block a user