From 349790339897466f323ff28748916aa48aa344f7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 29 Oct 2026 21:00:18 -0300 Subject: 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 --- src/normal.zig | 1 + src/pardes.zig | 15 +++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'src') 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(); -- cgit v1.3