From 6494301e3c4e5ab5fdfa260c00bf88c47272c629 Mon Sep 17 00:00:00 2001 From: Ingrid Date: Fri, 26 Apr 2024 21:37:35 +0200 Subject: [PATCH] reintroduce ensure_cursor_in_view in handle_config_events since we sorted out the borrow checker issues using partial borrows, there's nothing stopping us from going back to the simpler implementation --- helix-term/src/application.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 3d3caa0ab..db2b1b2db 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -384,9 +384,7 @@ impl Application { let scrolloff = self.editor.config().scrolloff; for (view, _) in self.editor.tree.views() { let doc = doc_mut!(self.editor, &view.doc); - if let Some(offset) = view.offset_coords_to_in_view_center::(doc, scrolloff) { - doc.view_data_mut(view.id).view_position = offset - } + view.ensure_cursor_in_view(doc, scrolloff); } }