summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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();