diff options
author | Omnikar | 2021-11-11 04:44:50 +0000 |
---|---|---|
committer | GitHub | 2021-11-11 04:44:50 +0000 |
commit | d131a9dd0efc5ff271f8b78cd65a8dc30c193af4 (patch) | |
tree | d7083b42822d6d37ea04eb291674909d1fb9d3fe /helix-term/src/ui | |
parent | bf70cfd050d961ce7b8d5a95fe663dff9eb1e66e (diff) |
Allow keys to be mapped to sequences of commands (#589)
* Allow keys to be mapped to sequences of commands
* Handle `Sequence` at the start of `Keymap::get`
* Use `"[Multiple commands]"` as command sequence doc
* Add command sequence example to `remapping.md`
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/editor.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index a7015577..90f09e9c 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -695,6 +695,11 @@ impl EditorView { match &key_result.kind { KeymapResultKind::Matched(command) => command.execute(cxt), KeymapResultKind::Pending(node) => self.autoinfo = Some(node.infobox()), + KeymapResultKind::MatchedSequence(commands) => { + for command in commands { + command.execute(cxt); + } + } KeymapResultKind::NotFound | KeymapResultKind::Cancelled(_) => return Some(key_result), } None |