diff options
Diffstat (limited to 'core/keys.zig')
| -rw-r--r-- | core/keys.zig | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/core/keys.zig b/core/keys.zig index 6f43e166..58777338 100644 --- a/core/keys.zig +++ b/core/keys.zig @@ -552,7 +552,29 @@ fn tagStateKey(p: *Pardes, key: Key) void { if (TagState.hostOf(p) == null or hit(key, config.escape)) return TagState.toRest(p); switch (s.kind) { .rest => unreachable, - .describe => return TagState.toRest(p), + .describe => { + const plain = !key.ctrl and !key.alt; + if (plain and key.cp == Key.enter and s.found) { + var out: [16]Key = undefined; + var path: [8]u8 = undefined; + const n = s.scope_n; + @memcpy(path[0..n], s.scope[0..n]); + const typed = bindings.keysOf(s.scope_root.?, path[0..n], &out); + TagState.toRest(p); + for (typed) |k| handleKey(p, k); + return; + } + if (plain and key.cp == Key.backspace) { + if (s.scope_n > 0 and s.scope_root != null) { + s.scope_n -= 1; + } else s.scope_root = null; + if (s.scope_root == null) s.scope_n = 0; + s.found = false; + s.missed = false; + return; + } + TagState.describeKey(p, key); + }, .help => { const plain = !key.ctrl and !key.alt; if (plain and key.cp == Key.enter) { |
