commit correct document

This commit is contained in:
anna
2011-12-19 18:28:46 +01:00
parent a8b8f69cdb
commit 2e9743d90e
@@ -678,9 +678,9 @@ public class VariableInplaceRenamer {
protected void revertState() {
CommandProcessor.getInstance().executeCommand(myProject, new Runnable() {
public void run() {
final Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(myEditor);
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
final Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(myEditor);
final TemplateState state = TemplateManagerImpl.getTemplateState(topLevelEditor);
assert state != null;
final int segmentsCount = state.getSegmentsCount();
@@ -691,9 +691,9 @@ public class VariableInplaceRenamer {
}
}
});
PsiDocumentManager.getInstance(myProject).commitDocument(topLevelEditor.getDocument());
}
}, RENAME_TITLE, null);
PsiDocumentManager.getInstance(myProject).commitDocument(myEditor.getDocument());
}
private static VirtualFile getTopLevelVirtualFile(final FileViewProvider fileViewProvider) {