on master help sign in
Restore deleted goto_pos function (#5164)
commit5c4a9cba9a14ca10437e979c884d2ccba78ef1e7 authorSebastian Zivota <loewenheim@users.noreply.github.com> dateThu 15 Dec 2022, 14:20 (4 years ago) parentf916915
1 file changed+8
helix-term/src/commands.rs+8
helix-term/src/commands.rs+8
@@ -2789,6 +2789,14 @@ fn exit_select_mode(cx: &mut Context) {
27892789 }
27902790}
27912791
2792+fn goto_pos(editor: &mut Editor, pos: usize) {
2793+ let (view, doc) = current!(editor);
2794+
2795+ push_jump(view, doc);
2796+ doc.set_selection(view.id, Selection::point(pos));
2797+ align_view(doc, view, Align::Center);
2798+}
2799+
27922800fn goto_first_diag(cx: &mut Context) {
27932801 let (view, doc) = current!(cx.editor);
27942802 let selection = match doc.diagnostics().first() {