Select the last root when right-clicking below all project panel entries

This commit is contained in:
Max Brunsfeld 2022-07-05 13:21:41 -07:00
parent ea1f6d6e00
commit 4aa19c1a7f
2 changed files with 64 additions and 62 deletions

View file

@ -1042,7 +1042,7 @@ impl Project {
pub fn worktrees<'a>(
&'a self,
cx: &'a AppContext,
) -> impl 'a + Iterator<Item = ModelHandle<Worktree>> {
) -> impl 'a + DoubleEndedIterator<Item = ModelHandle<Worktree>> {
self.worktrees
.iter()
.filter_map(move |worktree| worktree.upgrade(cx))
@ -1051,7 +1051,7 @@ impl Project {
pub fn visible_worktrees<'a>(
&'a self,
cx: &'a AppContext,
) -> impl 'a + Iterator<Item = ModelHandle<Worktree>> {
) -> impl 'a + DoubleEndedIterator<Item = ModelHandle<Worktree>> {
self.worktrees.iter().filter_map(|worktree| {
worktree.upgrade(cx).and_then(|worktree| {
if worktree.read(cx).is_visible() {