diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/editor/actions/GroovyEnterHandler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/editor/actions/GroovyEnterHandler.java index fa71dc1494e5..8e3748d4d660 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/editor/actions/GroovyEnterHandler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/editor/actions/GroovyEnterHandler.java @@ -247,7 +247,7 @@ public class GroovyEnterHandler extends EnterHandlerDelegateAdapter { EditorModificationUtil.insertStringAtCaret(editor, "\n"); } else { - EditorModificationUtil.insertStringAtCaret(editor, "\n"); + originalHandler.execute(editor, dataContext); } return true; } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy index b6360417d556..2660e3cbd008 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/EnterActionTest.groovy @@ -77,6 +77,7 @@ public class EnterActionTest extends GroovyFormatterTestCase { public void testGstring7() throws Throwable { doTest(); } public void testGstring8() throws Throwable { doTest(); } public void testGstring9() throws Throwable { doTest(); } + public void testMultilineIndent() throws Throwable { doTest(); } public void testSpaces1() throws Throwable { doTest(); } public void testString1() throws Throwable { doTest(); } public void testString2() throws Throwable { doTest(); } diff --git a/plugins/groovy/testdata/groovy/enterAction/multilineIndent.test b/plugins/groovy/testdata/groovy/enterAction/multilineIndent.test new file mode 100644 index 000000000000..8d65d37f1469 --- /dev/null +++ b/plugins/groovy/testdata/groovy/enterAction/multilineIndent.test @@ -0,0 +1,12 @@ +''' +class Foo { + void foo() {} +} +''' +----- +''' +class Foo { + void foo() {} + +} +''' \ No newline at end of file