WI-8102 replace all in selection should not deselect block

This commit is contained in:
andrey.zaytsev
2011-11-03 02:11:34 +03:00
parent eb251982e0
commit a8c8df6d64
@@ -475,10 +475,10 @@ public class FindUtil {
return true;
}
private static boolean doReplace(Project project, final Editor editor, FindModel model, final Document document, int caretOffset,
private static boolean doReplace(Project project, final Editor editor, final FindModel aModel, final Document document, int caretOffset,
boolean toPrompt, ReplaceDelegate delegate) {
FindManager findManager = FindManager.getInstance(project);
model = (FindModel)model.clone();
final FindModel model = (FindModel)aModel.clone();
int occurrences = 0;
List<Pair<TextRange,String>> rangesToChange = new ArrayList<Pair<TextRange, String>>();
@@ -588,7 +588,9 @@ public class FindUtil {
public void run() {
document.setText(newText);
editor.getCaretModel().moveToOffset(finalCaretOffset);
editor.getSelectionModel().removeSelection();
if (model.isGlobal()) {
editor.getSelectionModel().removeSelection();
}
}
});
}