on master help sign in
Add `no_op` command (#743)

* Add `no_op` command * Document `no_op` in `remapping.md`

commit3e12b0099342be12db1db64e36ca4ff29613f122 authorOmnikar <omkar.subramaniam@icloud.com> dateMon 13 Sep 2021, 04:48 (5 years ago) parent1540b37
2 files changed+5
book/src/remapping.md+2 helix-term/src/commands.rs+3
book/src/remapping.md+2
@@ -49,4 +49,6 @@ Control, Shift and Alt modifiers are encoded respectively with the prefixes
4949| Null | `"null"` |
5050| Escape | `"esc"` |
5151
52+Keys can be disabled by binding them to the `no_op` command.
53+
5254Commands 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 {
162162
163163 #[rustfmt::skip]
164164 commands!(
165+ no_op, "Do nothing",
165166 move_char_left, "Move left",
166167 move_char_right, "Move right",
167168 move_line_up, "Move up",
@@ -361,6 +362,8 @@ impl PartialEq for Command {
361362 }
362363}
363364
365+fn no_op(_cx: &mut Context) {}
366+
364367fn move_impl<F>(cx: &mut Context, move_fn: F, dir: Direction, behaviour: Movement)
365368where
366369 F: Fn(RopeSlice, Range, Direction, usize, Movement) -> Range,