Add keymatch modes so terminal can have cmd-k

This isn't my favorite idea of a fix, but it does work for now, and it
seems likely the terminal will need to configure other aspects of action
dispatch in the future.

In the future we should explore making it possible to do this via the
keymap, either by making disabling bindings more robust; or by having a
way to indicate immediate mode per binding.
This commit is contained in:
Conrad Irwin 2024-01-23 09:37:44 -07:00
parent ba5b969e10
commit 056da0a0f1
4 changed files with 44 additions and 11 deletions

View file

@ -762,6 +762,7 @@ impl Element for TerminalElement {
self.interactivity
.paint(bounds, bounds.size, state, cx, |_, _, cx| {
cx.handle_input(&self.focus, terminal_input_handler);
cx.keymatch_mode_immediate();
cx.on_key_event({
let this = self.terminal.clone();