summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 21:00:18 -0300
committerGabriel Schneider <[email protected]>2026-10-29 21:03:52 -0300
commit349790339897466f323ff28748916aa48aa344f7 (patch)
tree7364f4cb2a884c1d99e11b6f885a6a1b3a62f81d /src
parentfdf59131f68db19fc4818b6e5db7c9fe4cc609fd (diff)
downloadpardes-349790339897466f323ff28748916aa48aa344f7.tar.gz
pardes-349790339897466f323ff28748916aa48aa344f7.zip
keys: Esc in a column or the workspace tag in normal mode gives the keyboard back to a pane, as Shift-Esc does, instead of running Last underneath it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/normal.zig1
-rw-r--r--src/pardes.zig15
2 files changed, 16 insertions, 0 deletions
diff --git a/src/normal.zig b/src/normal.zig
index 25e2deec..5bc24b08 100644
--- a/src/normal.zig
+++ b/src/normal.zig
@@ -659,6 +659,7 @@ fn executeNormalAction(p: *Pardes, t: *Text, semantic: modal.Normal.Action) void
t.select = false;
// typed again by a macro, Esc is only helix's
if (p.macro.replaying > 0) return;
+ tagline.exitHeader(p); // out of a header too, as Shift-Esc
return exec.runBuiltin(p, .Last, p.active, "", null);
},
.goto => |go| switch (go.target) {
diff --git a/src/pardes.zig b/src/pardes.zig
index 5d889c86..eb09b1f2 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -8851,6 +8851,21 @@ test "Shift-Esc backs out to the previous pane in every mode, never into raw" {
try std.testing.expect(p.active != 0);
}
+test "Esc in a column or the workspace tag gives the keyboard back to a pane, as Shift-Esc does" {
+ if (platform == .web) return;
+ const p = try Pardes.init(std.testing.allocator, .{ .cols = 80, .rows = 24, .file = "mise.toml" });
+ defer p.deinit();
+ p.update(.{ .key = .{ .cp = 'n', .alt = true } }); // a pane to go back to
+ for ([_]?usize{ 0, null }) |column| {
+ tagline.enterHeader(p, column);
+ try std.testing.expect(tagline.focusedHeader(p) != null);
+ const was = p.active;
+ p.update(.{ .key = .{ .cp = Key.escape } });
+ try std.testing.expect(tagline.focusedHeader(p) == null);
+ try std.testing.expect(p.active != was);
+ }
+}
+
test "window mode moves an outline and focuses it on Enter, Esc or a label" {
const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 30 });
defer p.deinit();