Move history navigation logic to Workspace

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-05-29 19:47:59 +02:00
parent 6d3464fd1f
commit 88eb2b2163
8 changed files with 333 additions and 333 deletions

View file

@ -4931,12 +4931,12 @@ impl Editor {
}
fn push_to_nav_history(
&self,
&mut self,
cursor_anchor: Anchor,
new_position: Option<Point>,
cx: &mut ViewContext<Self>,
) {
if let Some(nav_history) = &self.nav_history {
if let Some(nav_history) = self.nav_history.as_mut() {
let buffer = self.buffer.read(cx).read(cx);
let cursor_position = cursor_anchor.to_point(&buffer);
let scroll_state = self.scroll_manager.anchor();