search: reset selected match when the needle changes

pull/9714/head
Mitchell Hashimoto 2025-11-26 10:04:26 -08:00
parent 71a2dad929
commit d85fc62774
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 4 additions and 0 deletions

View File

@ -291,6 +291,10 @@ fn changeNeedle(self: *Thread, needle: []const u8) !void {
.{ .total_matches = 0 },
self.opts.event_userdata,
);
cb(
.{ .selected_match = null },
self.opts.event_userdata,
);
cb(
.{ .viewport_matches = &.{} },
self.opts.event_userdata,