aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorOmnikar2021-12-10 02:46:24 +0000
committerGitHub2021-12-10 02:46:24 +0000
commitb66d3d3d9dccbb9c28d8611c4a0fc5d74ccb27d6 (patch)
treea9bda6d643424ff1a612fae5c3a1d76c26221fd7 /helix-term/src
parent44681c50572eb75dc3059e5de2c0f537e2c76706 (diff)
Add `save_selection` command (#1247)
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs7
-rw-r--r--helix-term/src/keymap.rs2
2 files changed, 8 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 1f7a2275..87c5a63f 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -362,6 +362,7 @@ impl MappableCommand {
expand_selection, "Expand selection to parent syntax node",
jump_forward, "Jump forward 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_left, "Jump to the split to the left",
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) {
cx.editor.focus_next()
}
diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs
index 9debbbac..b1613252 100644
--- a/helix-term/src/keymap.rs
+++ b/helix-term/src/keymap.rs
@@ -641,7 +641,7 @@ impl Default for Keymaps {
"tab" => jump_forward, // tab == <C-i>
"C-o" => jump_backward,
- // "C-s" => save_selection,
+ "C-s" => save_selection,
"space" => { "Space"
"f" => file_picker,