diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c645849f1d290..b0741cc1ab657 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2974,27 +2974,27 @@ fn jumplist_picker(cx: &mut Context) { } }; - let picker = Picker::new( - cx.editor - .tree - .views() - .flat_map(|(view, _)| { - view.jumps - .iter() - .map(|(doc_id, selection)| new_meta(view, *doc_id, selection.clone())) - }) - .collect(), - (), - |cx, meta, action| { - cx.editor.switch(meta.id, action); - let config = cx.editor.config(); - let (view, doc) = (view_mut!(cx.editor), doc_mut!(cx.editor, &meta.id)); - doc.set_selection(view.id, meta.selection.clone()); - if action.align_view(view, doc.id()) { - view.ensure_cursor_in_view_center(doc, config.scrolloff); - } - }, - ) + let mut options: Vec = cx + .editor + .tree + .views() + .flat_map(|(view, _)| { + view.jumps + .iter() + .map(|(doc_id, selection)| new_meta(view, *doc_id, selection.clone())) + }) + .collect(); + options.reverse(); + + let picker = Picker::new(options, (), |cx, meta, action| { + cx.editor.switch(meta.id, action); + let config = cx.editor.config(); + let (view, doc) = (view_mut!(cx.editor), doc_mut!(cx.editor, &meta.id)); + doc.set_selection(view.id, meta.selection.clone()); + if action.align_view(view, doc.id()) { + view.ensure_cursor_in_view_center(doc, config.scrolloff); + } + }) .with_preview(|editor, meta| { let doc = &editor.documents.get(&meta.id)?; let line = meta.selection.primary().cursor_line(doc.text().slice(..));