summaryrefslogtreecommitdiff
path: root/core/normal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/normal.zig')
-rw-r--r--core/normal.zig13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/normal.zig b/core/normal.zig
index 7efe0bf6..3dade7a6 100644
--- a/core/normal.zig
+++ b/core/normal.zig
@@ -1094,8 +1094,19 @@ pub fn textAction(e: Editor, t: *Text, a: modal.Normal.Action) edit.Error!void {
if (comptime Editor.lib) return;
// typed again by a macro, Esc is only helix's
if (e.p.macro.replaying > 0) return;
- // The warnings and errors first, then the previous pane.
+ // At rest a thing at a time (pick-ui SPEC ยง10.4): a search's
+ // tints, then the warnings and errors, then the selections
+ // (the primary kept); with none of them left, the previous pane.
+ if (e.p.panes[e.p.view().active]) |pane| if (t == &pane.body and (pane.places.pattern.len > 0 or pane.places.hits.items.len > 0)) {
+ pane.places.clear(e.p.gpa);
+ e.p.needs_frame = true;
+ return;
+ };
if (e.p.messages.retire(&.{ .warn, .@"error" }) > 0) return;
+ if (t.nsel > 0) {
+ t.nsel = 0;
+ return;
+ }
tagline.exitHeader(e.p); // out of a header too, as Shift-Esc
return exec.runBuiltin(e.p, .Last, e.p.view().active, "", null);
},