search: do not restart search if needle doesn't change

pull/9709/head
Mitchell Hashimoto 2025-11-25 15:40:44 -08:00
parent 3ce19a02ba
commit 72708b8253
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 3 additions and 0 deletions

View File

@ -279,6 +279,9 @@ fn changeNeedle(self: *Thread, needle: []const u8) !void {
// Stop the previous search
if (self.search) |*s| {
// If our search is unchanged, do nothing.
if (std.ascii.eqlIgnoreCase(s.viewport.needle(), needle)) return;
s.deinit();
self.search = null;