Skip to content

Conversation

@MohamedEmirHajji
Copy link
Contributor

Solution Summary for #282773

Problem: After Replace All, calling clear() disposed all file match objects and their model listeners, so when users undo, the changes weren't detected and the Replace All button stayed disabled.

Solution: Remove the clear() call and instead force immediate match updates via forceUpdateMatches(), which:

  1. Preserves folder/file match structure and model listeners
  2. Immediately re-searches all files (finding 0 matches after replacement)
  3. Batches all change events to avoid UI storms
  4. Allows undo operations to be detected since listeners remain active

Trade-off: Slightly slower with large result sets (requires re-searching files) compared to the instant clear(), but necessary to maintain the infrastructure for undo detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants