Add staged checkboxes to multibuffer headers (#24308)
Co-authored-by: Mikayla <mikayla@zed.dev> Release Notes: - N/A --------- Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
0671be215f
commit
5d1c56829a
6 changed files with 151 additions and 37 deletions
|
@ -15,6 +15,7 @@ use gpui::{
|
|||
use language::{Buffer, LanguageRegistry};
|
||||
use rpc::{proto, AnyProtoClient};
|
||||
use settings::WorktreeId;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use text::BufferId;
|
||||
use util::{maybe, ResultExt};
|
||||
|
@ -341,10 +342,18 @@ impl Repository {
|
|||
}
|
||||
|
||||
pub fn project_path_to_repo_path(&self, path: &ProjectPath) -> Option<RepoPath> {
|
||||
if path.worktree_id != self.worktree_id {
|
||||
self.worktree_id_path_to_repo_path(path.worktree_id, &path.path)
|
||||
}
|
||||
|
||||
pub fn worktree_id_path_to_repo_path(
|
||||
&self,
|
||||
worktree_id: WorktreeId,
|
||||
path: &Path,
|
||||
) -> Option<RepoPath> {
|
||||
if worktree_id != self.worktree_id {
|
||||
return None;
|
||||
}
|
||||
self.repository_entry.relativize(&path.path).log_err()
|
||||
self.repository_entry.relativize(path).log_err()
|
||||
}
|
||||
|
||||
pub fn open_commit_buffer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue