Pomyk's search and replace patch

Originally committed to SVN as r215.
This commit is contained in:
Rodrigo Braz Monteiro 2006-03-07 22:38:46 +00:00
parent b3618d42df
commit d74e8da400
1 changed files with 14 additions and 3 deletions

View File

@ -305,6 +305,17 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
OpenDialog(DoReplace);
return;
}
wxArrayInt sels = grid->GetSelection();
// if selection has changed reset values
if (sels[0] < curLine) {
curLine = sels[0];
Modified = false;
LastWasFind = true;
pos = 0;
matchLen = 0;
replaceLen = 0;
}
// Setup
int start = curLine;
@ -480,8 +491,7 @@ void SearchReplaceEngine::ReplaceAll() {
// Commit
if (count > 0) {
grid->ass->FlagAsModified();
if (updateVideo) grid->CommitChanges();
else Modified = true;
grid->CommitChanges();
wxMessageBox(wxString::Format(_("%i matches were replaced."),count));
}
@ -529,7 +539,8 @@ void SearchReplaceEngine::OpenDialog (bool replace) {
// it's the right type so give focus
if(replace == hasReplace) {
diag->Show();
diag->SetFocus(); // is needed?
diag->SetFocus();
OnDialogOpen();
return;
}
// wrong type - destroy and create the right one