Problem
When performing a complex refactor operation, such as refactoring or deleting files, there is always a confirmation dialog, which will interrupt the workflow when undone. Is there any way to turn off this dialog?
Cause
According to https://youtrack.jetbrains.com/issue/IDEA-63377/Undo-confirmation-dialog:
We show undo confirmation dialogs for operations that affect multiple files, and for some other operations like creating files. The confirmation is necessary because the undo will modify not only the file the user is looking at but also some other files, and it may not always be possible to revert changes to other files by Redo if some other actions have been executed after Undo.
it's behavior as designed
So far, closing it directly in the IDE is impossible.
Resolution
Here is a workaround:
First, open the IDE Scripting console by following this guide: https://www.jetbrains.com/help/idea/ide-scripting-console.html#open-the-ide-scripting-console Then enter this code (please choose Kotin):
import com.intellij.openapi.command.impl.UndoManagerImpl
UndoManagerImpl.ourNeverAskUser = true
Select it all with the mouse pointer or ⌘Сmd A (or Ctrl+A on Windows/Linux) and then press ⌘Сmd ⏎(or Ctrl+Enter on Windows/Linux) to run it.
Then it will not appear anymore. To restore, change the above code to false and run it again.
Note: this is just a temporary solution, it may not work in the future release, currently it works on IDEA 2023.3+.
Comments
0 comments
Please sign in to leave a comment.