diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 80120d41f45cb9ec973a429d7a1e0bb887029bc6..a2a776a29ce0c62abb7a1639b39f66f4dbcc5ee5 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -604,7 +604,7 @@ impl GitPanel { if let Ok(ix) = self.entries[conflicted_start..conflicted_start + self.conflicted_count] .binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(&path)) { - return Some(ix); + return Some(conflicted_start + ix); } } if self.tracked_count > 0 { @@ -616,7 +616,7 @@ impl GitPanel { if let Ok(ix) = self.entries[tracked_start..tracked_start + self.tracked_count] .binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(&path)) { - return Some(ix); + return Some(tracked_start + ix); } } if self.new_count > 0 { @@ -632,7 +632,7 @@ impl GitPanel { if let Ok(ix) = self.entries[untracked_start..untracked_start + self.new_count] .binary_search_by(|entry| entry.status_entry().unwrap().repo_path.cmp(&path)) { - return Some(ix); + return Some(untracked_start + ix); } } None