mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-06 03:00:50 +03:00
Don't push a duplicate nav entry when changing selections via the mouse
Co-Authored-By: Keith Simmons <keith@zed.dev>
This commit is contained in:
parent
10f176073d
commit
255a8c5d14
@ -1393,8 +1393,6 @@ impl Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.push_to_nav_history(newest_selection.head(), Some(end.to_point(&buffer)), cx);
|
|
||||||
|
|
||||||
let selection = Selection {
|
let selection = Selection {
|
||||||
id: post_inc(&mut self.next_selection_id),
|
id: post_inc(&mut self.next_selection_id),
|
||||||
start,
|
start,
|
||||||
@ -6279,6 +6277,7 @@ mod tests {
|
|||||||
editor.selected_display_ranges(cx),
|
editor.selected_display_ranges(cx),
|
||||||
&[DisplayPoint::new(3, 0)..DisplayPoint::new(3, 0)]
|
&[DisplayPoint::new(3, 0)..DisplayPoint::new(3, 0)]
|
||||||
);
|
);
|
||||||
|
assert!(nav_history.borrow_mut().pop_backward().is_none());
|
||||||
|
|
||||||
// Move the cursor a small distance via the mouse.
|
// Move the cursor a small distance via the mouse.
|
||||||
// Nothing is added to the navigation history.
|
// Nothing is added to the navigation history.
|
||||||
@ -6305,6 +6304,7 @@ mod tests {
|
|||||||
editor.selected_display_ranges(cx),
|
editor.selected_display_ranges(cx),
|
||||||
&[DisplayPoint::new(5, 0)..DisplayPoint::new(5, 0)]
|
&[DisplayPoint::new(5, 0)..DisplayPoint::new(5, 0)]
|
||||||
);
|
);
|
||||||
|
assert!(nav_history.borrow_mut().pop_backward().is_none());
|
||||||
|
|
||||||
editor
|
editor
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user