mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disallow model changes during undo confirmation dialog (EA-92445 - ISE: DocumentUndoProvider$MyEditorDocumentListener.beforeDocumentChange)
This commit is contained in:
@@ -17,6 +17,7 @@ package com.intellij.openapi.command.impl;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.TransactionGuard;
|
||||
import com.intellij.openapi.command.undo.DocumentReference;
|
||||
import com.intellij.openapi.command.undo.UndoableAction;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
@@ -194,14 +195,18 @@ abstract class UndoRedo {
|
||||
}
|
||||
|
||||
private boolean askUser() {
|
||||
String actionText = getActionName(myUndoableGroup.getCommandName());
|
||||
final boolean[] isOk = new boolean[1];
|
||||
TransactionGuard.getInstance().submitTransactionAndWait(() -> {
|
||||
String actionText = getActionName(myUndoableGroup.getCommandName());
|
||||
|
||||
if (actionText.length() > 80) {
|
||||
actionText = actionText.substring(0, 80) + "... ";
|
||||
}
|
||||
if (actionText.length() > 80) {
|
||||
actionText = actionText.substring(0, 80) + "... ";
|
||||
}
|
||||
|
||||
return Messages.showOkCancelDialog(myManager.getProject(), actionText + "?", getActionName(),
|
||||
Messages.getQuestionIcon()) == Messages.OK;
|
||||
isOk[0] = Messages.showOkCancelDialog(myManager.getProject(), actionText + "?", getActionName(),
|
||||
Messages.getQuestionIcon()) == Messages.OK;
|
||||
});
|
||||
return isOk[0];
|
||||
}
|
||||
|
||||
private boolean restore(EditorAndState pair) {
|
||||
|
||||
Reference in New Issue
Block a user