Skip to content

Commit

Permalink
Restore deleted goto_pos function (helix-editor#5164)
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim authored Dec 15, 2022
1 parent f916915 commit 5c4a9cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2789,6 +2789,14 @@ fn exit_select_mode(cx: &mut Context) {
}
}

fn goto_pos(editor: &mut Editor, pos: usize) {
let (view, doc) = current!(editor);

push_jump(view, doc);
doc.set_selection(view.id, Selection::point(pos));
align_view(doc, view, Align::Center);
}

fn goto_first_diag(cx: &mut Context) {
let (view, doc) = current!(cx.editor);
let selection = match doc.diagnostics().first() {
Expand Down

0 comments on commit 5c4a9cb

Please sign in to comment.