aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorSebastian Zivota2022-12-15 13:20:26 +0000
committerGitHub2022-12-15 13:20:26 +0000
commit5c4a9cba9a14ca10437e979c884d2ccba78ef1e7 (patch)
treee7b8ec172ad5162264907e1009c915f316db47aa /helix-term/src/commands.rs
parentf916915b53fa6fedd3f9106bcf58163083cc052e (diff)
Restore deleted goto_pos function (#5164)
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 0f04ecba..6cf49464 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -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() {