Chat find: re-register a highlight whose shared entry another text removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 00:46:00 +00:00
parent 65579c8b42
commit 393f06fa88
@@ -143,7 +143,11 @@ class _ChatFindHighlightState extends State<ChatFindHighlight> {
void _register(ChatFindTargets? targets, String? rowKey) {
final next = rowKey == null ? null : (rowKey, widget.text);
if (identical(targets, _targets) && next == _registered) {
if (next != null) targets!.texts[next.$1]![next.$2] = widget.rects;
// Another text with the same row and string may have unregistered
// the shared entry; put it back.
if (next != null) {
targets!.texts.putIfAbsent(next.$1, () => {})[next.$2] = widget.rects;
}
return;
}
_unregister();