feat(find_in_files): clear file list and log if no matches are found

This commit is contained in:
CJ van den Berg 2025-01-15 14:23:30 +01:00
parent 400af298d7
commit dcddd373b5
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 19 additions and 5 deletions

View file

@ -179,6 +179,8 @@ const Process = struct {
var exit_code: i64 = undefined;
if (try m.match(.{ tp.any, tp.any, "exited", 0 })) {
self.logger.print("found {d} matches", .{self.match_count});
} else if (try m.match(.{ tp.any, tp.any, "exited", 1 })) {
self.logger.print("no matches found", .{});
} else if (try m.match(.{ tp.any, tp.any, "error.FileNotFound", 1 })) {
self.logger.print_err(ripgrep_binary, "'{s}' executable not found", .{ripgrep_binary});
} else if (try m.match(.{ tp.any, tp.any, tp.extract(&err_msg), tp.extract(&exit_code) })) {