Project Diff 2 (#23891)
This adds a new version of the project diff editor to go alongside the new git panel. The basics seem to be working, but still todo: * [ ] Fix untracked files * [ ] Fix deleted files * [ ] Show commit message editor at top * [x] Handle empty state * [x] Fix panic where locator sometimes seeks to wrong excerpt Release Notes: - N/A
This commit is contained in:
parent
27a413a5e3
commit
45708d2680
21 changed files with 1023 additions and 125 deletions
|
@ -20,10 +20,8 @@ pub struct RepositorySelector {
|
|||
|
||||
impl RepositorySelector {
|
||||
pub fn new(project: Entity<Project>, window: &mut Window, cx: &mut Context<Self>) -> Self {
|
||||
let git_state = project.read(cx).git_state().cloned();
|
||||
let all_repositories = git_state
|
||||
.as_ref()
|
||||
.map_or(vec![], |git_state| git_state.read(cx).all_repositories());
|
||||
let git_state = project.read(cx).git_state().clone();
|
||||
let all_repositories = git_state.read(cx).all_repositories();
|
||||
let filtered_repositories = all_repositories.clone();
|
||||
let delegate = RepositorySelectorDelegate {
|
||||
project: project.downgrade(),
|
||||
|
@ -38,11 +36,8 @@ impl RepositorySelector {
|
|||
.max_height(Some(rems(20.).into()))
|
||||
});
|
||||
|
||||
let _subscriptions = if let Some(git_state) = git_state {
|
||||
vec![cx.subscribe_in(&git_state, window, Self::handle_project_git_event)]
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let _subscriptions =
|
||||
vec![cx.subscribe_in(&git_state, window, Self::handle_project_git_event)];
|
||||
|
||||
RepositorySelector {
|
||||
picker,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue