diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-02 18:04:34 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-10 09:17:07 -0300 |
| commit | 4ffc8ed795ff58426aea28d3b3b38df1428d2980 (patch) | |
| tree | 65c36f8b2a7c8a3f8597b23b95878a52423f4f20 /src/pardes.zig | |
| parent | 5961587b227e5fa097fb033e32c29da08a23fb18 (diff) | |
| download | pardes-4ffc8ed795ff58426aea28d3b3b38df1428d2980.tar.gz pardes-4ffc8ed795ff58426aea28d3b3b38df1428d2980.zip | |
normal Esc toggles document/terminal focus
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 86dcb97f..7b359f0d 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4151,19 +4151,20 @@ pub const Pardes = struct { const text = p.flatSurface(pane, pl) catch return; const lines = pl.lines; - // Esc: exit select mode / drop pending prefixes + count. The - // selection itself SURVIVES (helix; `;` collapses it) — motions - // replace it anyway. A buffer the table marks `dismiss` (every output - // buffer today) instead takes Esc as "never mind" and closes: Esc IS - // Del, the same builtin its tag offers. + // Esc: the fast document<->terminal hop, running the SAME Toggleterm + // builtin `SPC w t` does. Clear the normal-mode residue it used to + // cancel first: select mode and pending prefixes/count end here, while + // the selection itself SURVIVES (helix; `;` collapses it). Scoped Esc + // meanings (leader/tag/topbar/search cancel, insert -> normal, raw tty + // forwarding) are intercepted in handleKey before this body-normal + // handler and therefore stay unchanged. if (hit(key, config.escape)) { - if (pane.file) |f| if (output_pane.fileTraits(f.output).dismiss) return p.runBuiltin(.Del, p.active, "", null); pane.select = false; pane.pending = 0; pane.pending2 = 0; pane.pending_ch = 0; pane.count = 0; - return; + return p.runBuiltin(.Toggleterm, p.active, "", null); } // count prefix: digits accumulate while no prefix op is in flight // (`0` stays line-start until a count begins) |
