mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Undo: do no record originator for non-physical documents (like refactorings dialogs)
This commit is contained in:
@@ -231,6 +231,14 @@ public class CommandMerger {
|
||||
return !myCurrentActions.isEmpty();
|
||||
}
|
||||
|
||||
public boolean isPhysical() {
|
||||
if (myAllAffectedDocuments.isEmpty()) return false;
|
||||
for (DocumentReference each : myAllAffectedDocuments) {
|
||||
if (each.getFile() == null) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isUndoAvailable(@NotNull Collection<DocumentReference> refs) {
|
||||
if (hasNonUndoableActions()) {
|
||||
return false;
|
||||
|
||||
@@ -283,7 +283,7 @@ public class UndoManagerImpl extends UndoManager implements ProjectComponent, Ap
|
||||
myCommandLevel--;
|
||||
if (myCommandLevel > 0) return;
|
||||
|
||||
if (myProject != null && myCurrentMerger.hasActions() && !myCurrentMerger.isTransparent()) {
|
||||
if (myProject != null && myCurrentMerger.hasActions() && !myCurrentMerger.isTransparent() && myCurrentMerger.isPhysical()) {
|
||||
addFocusedDocumentAsAffected();
|
||||
}
|
||||
myOriginatorReference = null;
|
||||
|
||||
Reference in New Issue
Block a user