fix: logging of file matches

This commit is contained in:
CJ van den Berg 2024-08-17 23:49:35 +02:00
parent a65794f673
commit 36a24d84e3
2 changed files with 3 additions and 8 deletions

View file

@ -37,7 +37,6 @@ panels: ?*WidgetList = null,
last_match_text: ?[]const u8 = null,
location_history: location_history,
file_stack: std.ArrayList([]const u8),
find_in_files_count: usize = 0,
find_in_files_done: bool = false,
panel_height: ?usize = null,
@ -94,12 +93,9 @@ pub fn receive(self: *Self, from_: tp.pid_ref, m: tp.message) error{Exit}!bool {
var end_pos: usize = undefined;
var lines: []const u8 = undefined;
if (try m.match(.{ "FIF", tp.extract(&path), tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos), tp.extract(&lines) })) {
self.find_in_files_count += 1;
try self.add_find_in_files_result(path, begin_line, begin_pos, end_line, end_pos, lines);
return true;
} else if (try m.match(.{ "FIF", "done" })) {
log.logger("find").print("found {d} matches", .{self.find_in_files_count});
self.find_in_files_count = 0;
self.find_in_files_done = true;
return true;
} else if (try m.match(.{"write_restore_info"})) {