From fda7c41ecdd60efd519db357e6e0483ba8bd87ae Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 6 May 2010 22:08:29 +0400 Subject: [PATCH] perform postprocess reformatting before touching document (IDEA-53885) --- .../org/intellij/lang/regexp/surroundWith/GroupSurrounder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RegExpSupport/src/org/intellij/lang/regexp/surroundWith/GroupSurrounder.java b/RegExpSupport/src/org/intellij/lang/regexp/surroundWith/GroupSurrounder.java index 0f4c0c886d49..3d01eb203184 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/surroundWith/GroupSurrounder.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/surroundWith/GroupSurrounder.java @@ -22,6 +22,7 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiFileFactory; @@ -84,6 +85,7 @@ class GroupSurrounder implements Surrounder { if (isInsideStringLiteral(e)) { final Document doc = editor.getDocument(); + PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(doc); final TextRange tr = e.getTextRange(); doc.replaceString(tr.getStartOffset(), tr.getEndOffset(), StringUtil.escapeStringCharacters(element.getText()));