mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
A fix for IDEA-162922 Enter action produces 2 undo operations
This commit is contained in:
@@ -21,7 +21,7 @@ import com.intellij.openapi.editor.actionSystem.DocCommandGroupId;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler;
|
||||
|
||||
public abstract class BaseEnterHandler extends EditorWriteActionHandler {
|
||||
private static final String GROUP_ID = "EnterHandler.GROUP_ID";
|
||||
public static final String GROUP_ID = "EnterHandler.GROUP_ID";
|
||||
|
||||
protected BaseEnterHandler() {
|
||||
super(false);
|
||||
|
||||
+2
-4
@@ -25,8 +25,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class FormatterBasedIndentAdjuster {
|
||||
|
||||
private static final String ADJUST_INDENT_COMMAND_NAME = "Adjust Indent";
|
||||
|
||||
private FormatterBasedIndentAdjuster() {
|
||||
}
|
||||
|
||||
@@ -57,10 +55,10 @@ public class FormatterBasedIndentAdjuster {
|
||||
|
||||
public void run() {
|
||||
int lineStart = myDocument.getLineStartOffset(myLine);
|
||||
CommandProcessor.getInstance().executeCommand(myProject, () ->
|
||||
CommandProcessor.getInstance().runUndoTransparentAction(() ->
|
||||
ApplicationManager.getApplication().runWriteAction(() -> {
|
||||
CodeStyleManager.getInstance(myProject).adjustLineIndent(myDocument, lineStart);
|
||||
}), ADJUST_INDENT_COMMAND_NAME, null);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user