@@ -228,13 +228,14 @@ impl Command {
228228 goto_definition, "Goto definition",
229229 goto_type_definition, "Goto type definition",
230230 goto_implementation, "Goto implementation",
231− goto_file_start, "Goto file start",
231+ goto_file_start, "Goto file start/line",
232232 goto_file_end, "Goto file end",
233233 goto_reference, "Goto references",
234234 goto_window_top, "Goto window top",
235235 goto_window_middle, "Goto window middle",
236236 goto_window_bottom, "Goto window bottom",
237237 goto_last_accessed_file, "Goto last accessed file",
238+ goto_line, "Goto line",
238239 goto_first_diag, "Goto first diagnostic",
239240 goto_last_diag, "Goto last diagnostic",
240241 goto_next_diag, "Goto next diagnostic",
@@ -553,9 +554,13 @@ fn move_next_long_word_end(cx: &mut Context) {
553554}
554555
555556fn goto_file_start(cx: &mut Context) {
556− push_jump(cx.editor);
557− let (view, doc) = current!(cx.editor);
558− doc.set_selection(view.id, Selection::point(0));
557+ if cx.count.is_some() {
558+ goto_line(cx);
559+ } else {
560+ push_jump(cx.editor);
561+ let (view, doc) = current!(cx.editor);
562+ doc.set_selection(view.id, Selection::point(0));
563+ }
559564}
560565
561566fn goto_file_end(cx: &mut Context) {
@@ -2442,6 +2447,17 @@ fn push_jump(editor: &mut Editor) {
24422447 view.jumps.push(jump);
24432448}
24442449
2450+fn goto_line(cx: &mut Context) {
2451+ if let Some(count) = cx.count {
2452+ push_jump(cx.editor);
2453+
2454+ let (view, doc) = current!(cx.editor);
2455+ let line_idx = std::cmp::min(count.get() - 1, doc.text().len_lines().saturating_sub(2));
2456+ let pos = doc.text().line_to_char(line_idx);
2457+ doc.set_selection(view.id, Selection::point(pos));
2458+ }
2459+}
2460+
24452461fn goto_last_accessed_file(cx: &mut Context) {
24462462 let alternate_file = view!(cx.editor).last_accessed_doc;
24472463 if let Some(alt) = alternate_file {