mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
EA-1047558 [extract method]: revert editor state inside write action always
GitOrigin-RevId: f6ca59b7c1ee5a60fe42a2b14925e37d730d601c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
40f60bd16e
commit
b7ca72a251
@@ -17,19 +17,18 @@ class EditorState(val project: Project, val editor: Editor){
|
||||
private val textToRevert: String = editor.document.text
|
||||
|
||||
fun revert() {
|
||||
val undoManager = UndoManager.getInstance(project)
|
||||
WriteAction.run<Throwable> {
|
||||
if (undoManager.isUndoOrRedoInProgress) {
|
||||
ApplicationManager.getApplication().invokeLater { revertWithoutPostprocessing(project) }
|
||||
}
|
||||
else {
|
||||
revertWithoutPostprocessing(project)
|
||||
}
|
||||
if (UndoManager.getInstance(project).isUndoOrRedoInProgress) {
|
||||
ApplicationManager.getApplication().invokeLater { revertWithoutPostprocessing() }
|
||||
}
|
||||
else {
|
||||
revertWithoutPostprocessing()
|
||||
}
|
||||
}
|
||||
|
||||
private fun revertWithoutPostprocessing(project: Project) {
|
||||
private fun revertWithoutPostprocessing() {
|
||||
WriteAction.run<Throwable> {
|
||||
PostprocessReformattingAspect.getInstance(project).disablePostprocessFormattingInside(::revertState)
|
||||
}
|
||||
}
|
||||
|
||||
private fun revertState() {
|
||||
|
||||
Reference in New Issue
Block a user