Skip to content

Commit

Permalink
show newest options in jumplist picker first, fix docs (helix-editor#…
Browse files Browse the repository at this point in the history
…10095)

* docs: mention `<space>g` changed file picker

* picker(jumplist): show jumps in order from latest to oldest
  • Loading branch information
woojiq authored and postsolar committed Apr 4, 2024
1 parent 8f64ff1 commit 710fb55
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion book/src/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
1 change: 1 addition & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2958,6 +2958,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(),
Expand Down
2 changes: 1 addition & 1 deletion helix-view/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl JumpList {
self.jumps.retain(|(other_id, _)| other_id != doc_id);
}

pub fn iter(&self) -> impl Iterator<Item = &Jump> {
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &Jump> {
self.jumps.iter()
}

Expand Down

0 comments on commit 710fb55

Please sign in to comment.