Make navigation history work with project diagnostics

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra
2022-01-20 18:21:48 +01:00
co-authored by Nathan Sobo Max Brunsfeld
parent c450945001
commit 377e41a90f
3 changed files with 50 additions and 11 deletions
+9 -1
View File
@@ -470,7 +470,7 @@ impl Editor {
clone.nav_history = self
.nav_history
.as_ref()
.map(|nav_history| nav_history.clone(&cx.handle()));
.map(|nav_history| ItemNavHistory::new(nav_history.history(), &cx.handle()));
clone
}
@@ -2459,6 +2459,14 @@ impl Editor {
self.update_selections(vec![selection], Some(Autoscroll::Fit), cx);
}
pub fn set_nav_history(&mut self, nav_history: Option<ItemNavHistory>) {
self.nav_history = nav_history;
}
pub fn nav_history(&self) -> Option<&ItemNavHistory> {
self.nav_history.as_ref()
}
fn push_to_nav_history(
&self,
position: Anchor,