Skip to content

Fix search/replace preview freeze - #4

Open
urpflanze wants to merge 1 commit into
cb109:developfrom
urpflanze:fix/search-replace-freeze
Open

Fix search/replace preview freeze#4
urpflanze wants to merge 1 commit into
cb109:developfrom
urpflanze:fix/search-replace-freeze

Conversation

@urpflanze

Copy link
Copy Markdown

This fixes a freeze in search/replace preview when the replacement text
still contains the searched pattern.

Example:

  • Search for: 6_
  • Replace with: 6_1
  • All enabled
  • Preview on multiple selected items

In the failing case, 3ds Max could freeze for several minutes even with
as few as 5 selected items. When the freeze ended, the preview still did
not show the expected renamed result.

The previous loop could keep matching text that had just been inserted,
so it did not reliably progress through the string.

The fix makes the replacement continue on the remaining unprocessed
part of the text instead of searching the full updated string again.

The preview could freeze when the replacement text still contained
the searched pattern, for example replacing "6_" with "6_1".

The loop could keep matching text that had just been inserted,
so it did not reliably make progress through the string.

This change makes the replacement continue on the remaining
unprocessed part of the name instead of searching the full
updated string again.
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.

1 participant