search: reset selected match when the needle changes

This commit is contained in:
Mitchell Hashimoto
2025-11-26 10:04:26 -08:00
parent 71a2dad929
commit d85fc62774

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,