Implement Copy for multibuffer anchors

This commit is contained in:
Max Brunsfeld 2022-11-23 16:56:22 -08:00
parent f71145bb32
commit 718f802157
7 changed files with 26 additions and 34 deletions

View file

@ -542,7 +542,7 @@ fn test_navigation_history(cx: &mut gpui::MutableAppContext) {
// Set scroll position to check later
editor.set_scroll_position(Vector2F::new(5.5, 5.5), cx);
let original_scroll_position = editor.scroll_position;
let original_scroll_top_anchor = editor.scroll_top_anchor.clone();
let original_scroll_top_anchor = editor.scroll_top_anchor;
// Jump to the end of the document and adjust scroll
editor.move_to_end(&MoveToEnd, cx);
@ -556,12 +556,12 @@ fn test_navigation_history(cx: &mut gpui::MutableAppContext) {
assert_eq!(editor.scroll_top_anchor, original_scroll_top_anchor);
// Ensure we don't panic when navigation data contains invalid anchors *and* points.
let mut invalid_anchor = editor.scroll_top_anchor.clone();
let mut invalid_anchor = editor.scroll_top_anchor;
invalid_anchor.text_anchor.buffer_id = Some(999);
let invalid_point = Point::new(9999, 0);
editor.navigate(
Box::new(NavigationData {
cursor_anchor: invalid_anchor.clone(),
cursor_anchor: invalid_anchor,
cursor_position: invalid_point,
scroll_top_anchor: invalid_anchor,
scroll_top_row: invalid_point.row,