diff options
Diffstat (limited to 'src/look.zig')
| -rw-r--r-- | src/look.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/look.zig b/src/look.zig index 0baa9afc..f45fe583 100644 --- a/src/look.zig +++ b/src/look.zig @@ -667,7 +667,10 @@ pub fn runSearch(p: *Pardes, id: usize, pat_raw: []const u8, kind: Search, start nrows += 1; } } - if (!open_empty and nrows == 0) return 0; + // A Find or Grep that finds nothing empties its directory's +Search, if + // there is one, rather than leave the last search's rows looking like + // this one's. + if (!open_empty and nrows == 0 and (kind == .text or !panes.Output.hasFileSearch(p, dir))) return 0; const content = try p.gpa.dupe(u8, out[0..out_len]); // the buffer records WHICH search filled it, pattern and all: Find and // Grep are builtins (words you can execute), the bare `/` is a key |
