Tested on Sublime Text 3, stable channel, Build 3059. Mac OS X 10.8.5.
Summary:
When doing a Find in files & Replace All, the “Replace” field, even if left blank, autofills with last string in that field’s history when clicking on “Replace All”.
Steps to reproduce:
-
Open several files in Sublime Text.
-
Do a Find in files & Replace All. Be sure to add a value in Find and in Replace. I only verified the bug with a string in “Find” that did produce at least a match.
-
Quit Sublime Text
-
Drag several files into Sublime Text’s icon to open them at the same time.
-
Do a Find in files & Replace All. The field “Find” should contain the last string in that field’s history, but the field “Replace” should be blank. Make sure the string in “Find” will produce matches.
-
Click “Replace All”.
Expected results:
After the confirmation dialog, the matched string should be erased in the matched files.
Actual results:
Right when the confirmation dialog appears, the field “Replace” surreptitiously gets automatically filled in with the last string in that field’s history. Accepting the confirmation will replace the matched strings with that autofilled value, instead of simply erasing the matched strings.
Additional notes:
Not one bit funny when doing so on tens or hundreds of files, as after the replacement there is no way to discard those changes all at once. Trying to close all documents at once in order to revert all changes to the last saved version, will make Sublime Text prompt a confirmation dialog for each and every file it mistakenly modified.