[rd-editor] IJPL-185748 Frontend speculative undo/redo

GitOrigin-RevId: 58a5cc8f70827e79d080d236332de18022c26e6c
This commit is contained in:
Alexander Trushev
2025-06-02 22:15:09 +02:00
committed by intellij-monorepo-bot
parent 25f56bbecf
commit e530e2a172
2 changed files with 7 additions and 3 deletions

View File

@@ -232,6 +232,7 @@ final class UndoClientState implements Disposable {
void flushCurrentCommand() {
commandMerger.flushCurrentCommand(undoStacksHolder, nextCommandTimestamp());
undoSpy.flushCommand(project);
}
boolean isInsideCommand() {

View File

@@ -31,12 +31,15 @@ interface UndoSpy {
isTransparent: Boolean,
)
fun flushCommand(project: Project?)
companion object {
@JvmField
val BLIND: UndoSpy = object : UndoSpy {
override fun commandStarted(project: Project?, undoConfirmationPolicy: UndoConfirmationPolicy) = Unit
override fun addUndoableAction(action: UndoableAction, type: UndoableActionType) = Unit
override fun commandFinished(project: Project?, commandName: @Command String?, commandGroupId: Any?, isTransparent: Boolean) = Unit
override fun commandStarted(project: Project?, undoConfirmationPolicy: UndoConfirmationPolicy) {}
override fun addUndoableAction(action: UndoableAction, type: UndoableActionType) {}
override fun commandFinished(project: Project?, commandName: @Command String?, commandGroupId: Any?, isTransparent: Boolean) {}
override fun flushCommand(project: Project?) {}
}
}
}