on master help sign in
Add `no_op` command (#743)
3e12b00Omnikar
book/src/remapping.md+2
@@ -49,4 +49,6 @@ Control, Shift and Alt modifiers are encoded respectively with the prefixes
49| Null | `"null"` |
49| Null | `"null"` |
50| Escape | `"esc"` |
50| Escape | `"esc"` |
51
51
52+Keys can be disabled by binding them to the `no_op` command.
53+
52Commands can be found in the source code at [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs)
54Commands can be found in the source code at [`helix-term/src/commands.rs`](https://github.com/helix-editor/helix/blob/master/helix-term/src/commands.rs)
helix-term/src/commands.rs+3
@@ -162,6 +162,7 @@ impl Command {
162
162
163 #[rustfmt::skip]
163 #[rustfmt::skip]
164 commands!(
164 commands!(
165+ no_op, "Do nothing",
165 move_char_left, "Move left",
166 move_char_left, "Move left",
166 move_char_right, "Move right",
167 move_char_right, "Move right",
167 move_line_up, "Move up",
168 move_line_up, "Move up",
@@ -361,6 +362,8 @@ impl PartialEq for Command {
361 }
362 }
362}
363}
363
364
365+fn no_op(_cx: &mut Context) {}
366+
364fn move_impl<F>(cx: &mut Context, move_fn: F, dir: Direction, behaviour: Movement)
367fn move_impl<F>(cx: &mut Context, move_fn: F, dir: Direction, behaviour: Movement)
365where
368where
366 F: Fn(RopeSlice, Range, Direction, usize, Movement) -> Range,
369 F: Fn(RopeSlice, Range, Direction, usize, Movement) -> Range,