show newest options in jumplist picker first, fix docs (#10095)

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

* picker(jumplist): show jumps in order from latest to oldest
This commit is contained in:
woojiq 2024-04-02 17:39:44 +03:00 committed by GitHub
parent e63ed0579d
commit cc8290f393
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -280,7 +280,8 @@ #### Space mode
| `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` |

View File

@ -2980,6 +2980,7 @@ fn format(&self, _data: &Self::Data) -> Row {
.flat_map(|(view, _)| {
view.jumps
.iter()
.rev()
.map(|(doc_id, selection)| new_meta(view, *doc_id, selection.clone()))
})
.collect(),

View File

@ -79,7 +79,7 @@ pub fn remove(&mut self, doc_id: &DocumentId) {
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()
}