Worktree paths in git panel, take 2 (#26047)
Modified version of #25950. We still use worktree paths, but repo paths with a status that lie outside the worktree are not excluded; instead, we relativize them by adding `..`. This makes the list in the git panel match what you'd get from running `git status` (with the repo's worktree root as the working directory). - [x] Implement + test new unrelativization logic - [x] ~~When collecting repositories, dedup by .git abs path, so worktrees can share a repo at the project level~~ dedup repos at the repository selector layer, with repos coming from larger worktrees being preferred - [x] Open single-file worktree with diff when activating a path not in the worktree Release Notes: - N/A
This commit is contained in:
parent
330e799293
commit
1763dd714b
23 changed files with 724 additions and 184 deletions
|
@ -9,7 +9,7 @@ use picker::{Picker, PickerDelegate};
|
|||
use std::{borrow::Borrow, fs, sync::Arc};
|
||||
use ui::{prelude::*, HighlightedLabel, ListItem, ListItemSpacing};
|
||||
use util::ResultExt;
|
||||
use workspace::{notifications::NotifyResultExt, ModalView, Workspace};
|
||||
use workspace::{notifications::NotifyResultExt, ModalView, OpenOptions, OpenVisible, Workspace};
|
||||
|
||||
actions!(snippets, [ConfigureSnippets, OpenFolder]);
|
||||
|
||||
|
@ -144,7 +144,10 @@ impl PickerDelegate for ScopeSelectorDelegate {
|
|||
workspace
|
||||
.open_abs_path(
|
||||
config_dir().join("snippets").join(scope + ".json"),
|
||||
false,
|
||||
OpenOptions {
|
||||
visible: Some(OpenVisible::None),
|
||||
..Default::default()
|
||||
},
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue