summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pardes.zig5
-rw-r--r--test/snapshots/leader.golden41
-rw-r--r--test/snapshots/leader.snap7
3 files changed, 52 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index c88687d0..89f295cc 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -2005,8 +2005,11 @@ pub const Pardes = struct {
// Esc: exit select mode / drop pending prefixes + count. The
// selection itself SURVIVES (helix; `;` collapses it) — motions
- // replace it anyway.
+ // replace it anyway. On an OUTPUT BUFFER (+Search, +Help) there is no
+ // file behind the pane and nothing worth keeping, so "never mind"
+ // means dismiss it: Esc IS Del, the same builtin its tag offers.
if (is(key, Key.escape)) {
+ if (pane.file) |f| if (f.output) return p.runBuiltin(.Del, p.active, "");
pane.select = false;
pane.pending = 0;
pane.pending2 = 0;
diff --git a/test/snapshots/leader.golden b/test/snapshots/leader.golden
index 9bf559c0..d89997f1 100644
--- a/test/snapshots/leader.golden
+++ b/test/snapshots/leader.golden
@@ -367,3 +367,44 @@
| 16 SPC w Save
| 17
|
+== snap esc-del grid=100x40 cursor=7,2
+|Kill Newcol Tutor Debug Colors NextColor Crt Dump
+| NOR /tmp/pardes-snap/leader/cwd/cmds.txt Save De NOR /tmp/pardes-snap/leader/cwd Del
+| 1 Help
+| cmds.txt
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
diff --git a/test/snapshots/leader.snap b/test/snapshots/leader.snap
index 9da5f288..26d11cd7 100644
--- a/test/snapshots/leader.snap
+++ b/test/snapshots/leader.snap
@@ -62,3 +62,10 @@ key ?
wait 10000 SPC s r
stable 700 15000
snap help-all
+# Esc in the BODY of an output buffer IS Del: +Help has no file behind it and
+# nothing worth keeping, so the key that elsewhere only drops a selection
+# dismisses the whole pane and hands its height back to the pane above.
+key esc
+settle 700
+stable 700 15000
+snap esc-del