Undo a replace all action correctly (Bug #2825280)
This commit is contained in:
parent
6d6ade623e
commit
cc30ea4961
|
@ -1908,6 +1908,8 @@ void MyFrame::OnDialogReplaceAll ( wxFindDialogEvent& event )
|
||||||
doc->SetTargetEnd ( doc->GetLength() );
|
doc->SetTargetEnd ( doc->GetLength() );
|
||||||
doc->SetSearchFlags ( flags );
|
doc->SetSearchFlags ( flags );
|
||||||
|
|
||||||
|
doc->BeginUndoAction();
|
||||||
|
|
||||||
int newLocation, replacementCount, regexWidth;
|
int newLocation, replacementCount, regexWidth;
|
||||||
newLocation = replacementCount = regexWidth = 0;
|
newLocation = replacementCount = regexWidth = 0;
|
||||||
|
|
||||||
|
@ -1926,8 +1928,10 @@ void MyFrame::OnDialogReplaceAll ( wxFindDialogEvent& event )
|
||||||
doc->SetTargetEnd ( doc->GetLength() );
|
doc->SetTargetEnd ( doc->GetLength() );
|
||||||
++replacementCount;
|
++replacementCount;
|
||||||
}
|
}
|
||||||
wxString msg;
|
|
||||||
|
|
||||||
|
doc->EndUndoAction();
|
||||||
|
|
||||||
|
wxString msg;
|
||||||
msg.Printf (
|
msg.Printf (
|
||||||
ngettext ( L"%i replacement made", L"%i replacements made", replacementCount ),
|
ngettext ( L"%i replacement made", L"%i replacements made", replacementCount ),
|
||||||
replacementCount );
|
replacementCount );
|
||||||
|
|
Loading…
Reference in New Issue