diff --git a/src/components/changes.rs b/src/components/changes.rs index 523ae568..27458e8e 100644 --- a/src/components/changes.rs +++ b/src/components/changes.rs @@ -320,7 +320,21 @@ impl Component for ChangesComponent { fn focused(&self) -> bool { self.files.focused() } + fn focus(&mut self, focus: bool) { self.files.focus(focus); } + + fn is_visible(&self) -> bool { + self.files.is_visible() + } + + fn hide(&mut self) { + self.files.hide(); + } + + fn show(&mut self) -> Result<()> { + self.files.show()?; + Ok(()) + } } diff --git a/src/components/status_tree.rs b/src/components/status_tree.rs index 12272070..fb752ddf 100644 --- a/src/components/status_tree.rs +++ b/src/components/status_tree.rs @@ -70,6 +70,7 @@ impl StatusTreeComponent { /// pub fn update(&mut self, list: &[StatusItem]) -> Result<()> { self.pending = false; + let new_hash = hash(list); if self.current_hash != new_hash { self.tree.update(list)?; @@ -373,6 +374,7 @@ impl DrawableComponent for StatusTreeComponent { ) }) .skip(self.scroll_top.get()); + ui::draw_list( f, r, diff --git a/src/tabs/status.rs b/src/tabs/status.rs index eab771df..544986df 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -427,6 +427,7 @@ impl Status { } fn check_remotes(&mut self) { + //TODO: make get_branches_info async self.has_remotes = sync::get_branches_info(&self.repo.borrow(), false) .map(|branches| !branches.is_empty()) @@ -965,10 +966,16 @@ impl Component for Status { fn hide(&mut self) { self.visible = false; + + self.index.hide(); + self.index_wd.hide(); } fn show(&mut self) -> Result<()> { self.visible = true; + self.index.show()?; + self.index_wd.show()?; + self.check_remotes(); self.update()?;