perform interactive text replace inside a transaction
authorpeter <peter@jetbrains.com>
Wed, 4 May 2016 07:08:39 +0000 (09:08 +0200)
committerpeter <peter@jetbrains.com>
Wed, 4 May 2016 08:20:10 +0000 (10:20 +0200)
platform/lang-impl/src/com/intellij/find/replaceInProject/ReplaceInProjectManager.java

index 73ab3bbcd0f7061b9f7b53d70f11b82b9c1d4655..5faf9a315137bd2bb11cbcd73a285040d18eeafb 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.actionSystem.KeyboardShortcut;
 import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.TransactionGuard;
 import com.intellij.openapi.command.CommandProcessor;
 import com.intellij.openapi.components.ServiceManager;
 import com.intellij.openapi.editor.Document;
@@ -219,7 +220,7 @@ public class ReplaceInProjectManager {
         @Override
         public void findingUsagesFinished(final UsageView usageView) {
           if (context[0] != null && findManager.getFindInProjectModel().isPromptOnReplace()) {
-            SwingUtilities.invokeLater(new Runnable() {
+            TransactionGuard.submitTransaction(myProject, new Runnable() {
               @Override
               public void run() {
                 replaceWithPrompt(context[0]);