Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Search/Replace    [ Add a report in this area ]  
Report #:  89790   Status: Open
regular expression search and replace freezes the IDE
Project:  Delphi Build #:  15.0.3953.35171
Version:    15.0 Submitted By:   Peter Below
Report Type:  Crash / Data loss / Total failure Date Reported:  11/18/2010 7:16:20 AM
Severity:    Infrequently encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   281245
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
A regular expression search and replace freezes the IDE with full CPU usage of one core under certain conditions.
Steps to Reproduce:
Open the attached project source file in the IDE. Use Ctrl-End to place the caret at the end
of the file and press the Enter key once to add an empty line. Scroll up to line 16.
Place the caret at the start of the line 16 ({tpUnknown}). Use Shift+Ctrl+End to select all
text from this location to the end of file. Call up the Replace dialog (Ctrl-R or mouse via
menu). In the dialog enter (without the quotes) "^ +" as the text to find, leave "replace with" empty, check only "Regular expressions" in the Options group, Forward in the Direction group, Selected text in the Scope group, and Entire scope in the Origin group (should all be set by default). Refer to the ReplaceSettings.png image in the attachment. Click the Replace All button.

Expected: All spaces at the start of lines in the selected block are removed.
Actual: The IDE freezes, showing the hourglass cursor and consuming all resources for one CPU core.

Note that this only happens when there is at least one empty line after the last line
containing text and it is not always reproducable when the file is saved before the replace operation is performed. When not saving it has been 100% reproducable for me.
Workarounds
Don't select empty lines after the last line containing text.
Attachment
89790.zip
Comments

None

Server Response from: ETNACODE01