on master help sign in
experiment: Move keep_primary_selection to ,
commit9ea9e779b2eef293c14ae50d5767035c0a9544a5 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 8 Sep 2021, 16:53 (5 years ago) parenta958d34
3 files changed+6−6
book/src/keymap.md+1−2 helix-term/src/commands.rs+4 helix-term/src/keymap.rs+1−4
book/src/keymap.md+1−2
@@ -86,6 +86,7 @@
8686| `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
8787| `;` | Collapse selection onto a single cursor | `collapse_selection` |
8888| `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
89+| `,` | Keep only the primary selection | `keep_primary_selection` |
8990| `C` | Copy selection onto the next line | `copy_selection_on_next_line` |
9091| `Alt-C` | Copy selection onto the previous line | `copy_selection_on_prev_line` |
9192| `(` | Rotate main selection forward | `rotate_selections_backward` |
@@ -99,7 +100,6 @@
99100| `J` | Join lines inside selection | `join_selections` |
100101| `K` | Keep selections matching the regex TODO: overlapped by hover help | `keep_selections` |
101102| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
102−| `Space` | Keep only the primary selection TODO: overlapped by space mode | `keep_primary_selection` |
103103| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
104104
105105### Search
@@ -200,7 +200,6 @@ This layer is a kludge of mappings, mostly pickers.
200200| `a` | Apply code action | `code_action` |
201201| `'` | Open last fuzzy picker | `last_picker` |
202202| `w` | Enter [window mode](#window-mode) | N/A |
203−| `space` | Keep primary selection TODO: it's here because space mode replaced it | `keep_primary_selection` |
204203| `p` | Paste system clipboard after selections | `paste_clipboard_after` |
205204| `P` | Paste system clipboard before selections | `paste_clipboard_before` |
206205| `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` |
helix-term/src/commands.rs+4
@@ -2825,6 +2825,10 @@ fn open_above(cx: &mut Context) {
28252825fn normal_mode(cx: &mut Context) {
28262826 let (view, doc) = current!(cx.editor);
28272827
2828+ if doc.mode == Mode::Normal {
2829+ return;
2830+ }
2831+
28282832 doc.mode = Mode::Normal;
28292833
28302834 doc.append_changes_to_history(view.id);
helix-term/src/keymap.rs+1−4
@@ -436,7 +436,6 @@ impl Default for Keymaps {
436436 "A" => append_to_line,
437437 "o" => open_below,
438438 "O" => open_above,
439− // [<space> ]<space> equivalents too (add blank new line, no edit)
440439
441440 "d" => delete_selection,
442441 // TODO: also delete without yanking
@@ -500,8 +499,7 @@ impl Default for Keymaps {
500499 "K" => keep_selections,
501500 // TODO: and another method for inverse
502501
503− // TODO: clashes with space mode
504− "space" => keep_primary_selection,
502+ "," => keep_primary_selection,
505503
506504 // "q" => record_macro,
507505 // "Q" => replay_macro,
@@ -554,7 +552,6 @@ impl Default for Keymaps {
554552 "p" => paste_clipboard_after,
555553 "P" => paste_clipboard_before,
556554 "R" => replace_selections_with_clipboard,
557− "space" => keep_primary_selection,
558555 "/" => global_search,
559556 },
560557 "z" => { "View"