From ba0a3a74aebec43a2475de803e1394a1db386924 Mon Sep 17 00:00:00 2001 From: woojiq Date: Tue, 2 Apr 2024 17:01:26 +0300 Subject: [PATCH] picker(jumplist): show jumps in order from latest to oldest --- helix-term/src/commands.rs | 1 + helix-view/src/view.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index d0b9047c8ad6..e7a75eb1adb9 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2980,6 +2980,7 @@ fn jumplist_picker(cx: &mut Context) { .flat_map(|(view, _)| { view.jumps .iter() + .rev() .map(|(doc_id, selection)| new_meta(view, *doc_id, selection.clone())) }) .collect(), diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index b5dc0615a5af..5b283b98f98d 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -79,7 +79,7 @@ impl JumpList { self.jumps.retain(|(other_id, _)| other_id != doc_id); } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl DoubleEndedIterator { self.jumps.iter() }