From 74fb68ea2d3a1519735ebbec82ba0e3845bfe3a7 Mon Sep 17 00:00:00 2001 From: woojiq <122799969+woojiq@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:39:44 +0300 Subject: [PATCH] show newest options in jumplist picker first, fix docs (#10095) * docs: mention `g` changed file picker * picker(jumplist): show jumps in order from latest to oldest --- book/src/keymap.md | 3 ++- helix-term/src/commands.rs | 1 + helix-view/src/view.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/book/src/keymap.md b/book/src/keymap.md index 3a5ccca53311..73f7a8532a96 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -280,7 +280,8 @@ This layer is a kludge of mappings, mostly pickers. | `F` | Open file picker at current working directory | `file_picker_in_current_directory` | | `b` | Open buffer picker | `buffer_picker` | | `j` | Open jumplist picker | `jumplist_picker` | -| `g` | Debug (experimental) | N/A | +| `g` | Open changed file picker | `changed_file_picker` | +| `G` | Debug (experimental) | N/A | | `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` | | `s` | Open document symbol picker (**LSP**) | `symbol_picker` | | `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` | diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index fce956073efa..248b631ecd60 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2982,6 +2982,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() }