project_panel: Fix indent guide collapse on secondary click for multiple worktrees (#33939)
Release Notes: - Fixed issue where `cmd`/`ctrl` click on indent guide would not collapse directory in case of multiple projects.
This commit is contained in:
parent
44d1f512f8
commit
76fe33245f
1 changed files with 4 additions and 3 deletions
|
@ -3303,12 +3303,13 @@ impl ProjectPanel {
|
|||
fn entry_at_index(&self, index: usize) -> Option<(WorktreeId, GitEntryRef<'_>)> {
|
||||
let mut offset = 0;
|
||||
for (worktree_id, visible_worktree_entries, _) in &self.visible_entries {
|
||||
if visible_worktree_entries.len() > offset + index {
|
||||
let current_len = visible_worktree_entries.len();
|
||||
if index < offset + current_len {
|
||||
return visible_worktree_entries
|
||||
.get(index)
|
||||
.get(index - offset)
|
||||
.map(|entry| (*worktree_id, entry.to_ref()));
|
||||
}
|
||||
offset += visible_worktree_entries.len();
|
||||
offset += current_len;
|
||||
}
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue