Add `save_selection` command (#1247)

pull/1255/head
Omnikar 3 years ago committed by GitHub
parent 44681c5057
commit b66d3d3d9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,6 +34,7 @@
| `Ctrl-d` | Move half page down | `half_page_down` | | `Ctrl-d` | Move half page down | `half_page_down` |
| `Ctrl-i` | Jump forward on the jumplist | `jump_forward` | | `Ctrl-i` | Jump forward on the jumplist | `jump_forward` |
| `Ctrl-o` | Jump backward on the jumplist | `jump_backward` | | `Ctrl-o` | Jump backward on the jumplist | `jump_backward` |
| `Ctrl-s` | Save the current selection to the jumplist | `save_selection` |
| `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` | | `v` | Enter [select (extend) mode](#select--extend-mode) | `select_mode` |
| `g` | Enter [goto mode](#goto-mode) | N/A | | `g` | Enter [goto mode](#goto-mode) | N/A |
| `m` | Enter [match mode](#match-mode) | N/A | | `m` | Enter [match mode](#match-mode) | N/A |

@ -362,6 +362,7 @@ impl MappableCommand {
expand_selection, "Expand selection to parent syntax node", expand_selection, "Expand selection to parent syntax node",
jump_forward, "Jump forward on jumplist", jump_forward, "Jump forward on jumplist",
jump_backward, "Jump backward on jumplist", jump_backward, "Jump backward on jumplist",
save_selection, "Save the current selection to the jumplist",
jump_view_right, "Jump to the split to the right", jump_view_right, "Jump to the split to the right",
jump_view_left, "Jump to the split to the left", jump_view_left, "Jump to the split to the left",
jump_view_up, "Jump to the split above", jump_view_up, "Jump to the split above",
@ -5285,6 +5286,12 @@ fn jump_backward(cx: &mut Context) {
}; };
} }
fn save_selection(cx: &mut Context) {
push_jump(cx.editor);
cx.editor
.set_status("Selection saved to jumplist".to_owned());
}
fn rotate_view(cx: &mut Context) { fn rotate_view(cx: &mut Context) {
cx.editor.focus_next() cx.editor.focus_next()
} }

@ -641,7 +641,7 @@ impl Default for Keymaps {
"tab" => jump_forward, // tab == <C-i> "tab" => jump_forward, // tab == <C-i>
"C-o" => jump_backward, "C-o" => jump_backward,
// "C-s" => save_selection, "C-s" => save_selection,
"space" => { "Space" "space" => { "Space"
"f" => file_picker, "f" => file_picker,

Loading…
Cancel
Save