summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/look.zig b/src/look.zig
index ba022bef..fa86aee4 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -620,8 +620,10 @@ pub fn runSearch(p: *Pardes, id: usize, pat_raw: []const u8, kind: Search, start
error.FileNotFound, error.NotDir, error.AccessDenied => continue,
else => return err,
};
+ nrows = std.mem.count(u8, out[0..out_len], "\n");
} else if (kind == .find) {
out_len = try filesystem.find(arena, dir, pat, out);
+ nrows = std.mem.count(u8, out[0..out_len], "\n");
} else if (pane.hasPdf()) {
if (comptime pdf_enabled) {
const found = try panes.Pdf.searchRows(
@@ -661,7 +663,7 @@ pub fn runSearch(p: *Pardes, id: usize, pat_raw: []const u8, kind: Search, start
nrows += 1;
}
}
- if (!open_empty and (kind == .text or kind == .grep) and nrows == 0) return 0;
+ if (!open_empty and nrows == 0) 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