diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/processors/GroovyWrappingProcessor.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/processors/GroovyWrappingProcessor.java index 67281f093d4b..704a652b60df 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/processors/GroovyWrappingProcessor.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/formatter/processors/GroovyWrappingProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -237,7 +237,8 @@ public class GroovyWrappingProcessor { } public Wrap getChainedMethodCallWrap() { - return Wrap.createWrap(mySettings.METHOD_CALL_CHAIN_WRAP, false); + return myContext.isInsidePlainGString() ? Wrap.createWrap(WrapType.NONE, false) + : Wrap.createWrap(mySettings.METHOD_CALL_CHAIN_WRAP, false); } private TokenSet ANNOTATION_CONTAINERS = TokenSet.create( diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy index 01cb0f735a43..bea7f0742361 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/formatter/FormatterTest.groovy @@ -798,6 +798,8 @@ def foo() { } } + void testNoLineFeedsInGString() { doTest() } + private void doGeeseTest() { GroovyCodeStyleSettings customSettings = myTempSettings.getCustomSettings(GroovyCodeStyleSettings.class) boolean oldvalue = customSettings.USE_FLYING_GEESE_BRACES diff --git a/plugins/groovy/testdata/groovy/formatter/noLineFeedsInGString.test b/plugins/groovy/testdata/groovy/formatter/noLineFeedsInGString.test new file mode 100644 index 000000000000..d01b36fdeb88 --- /dev/null +++ b/plugins/groovy/testdata/groovy/formatter/noLineFeedsInGString.test @@ -0,0 +1,3 @@ +print " {left(email.user?.raw, (length / 2).toInteger())}@${left(email.domain?.raw, (length - length / 2 - 1).toInteger())}" +----- +print " {left(email.user?.raw, (length / 2).toInteger())}@${left(email.domain?.raw, (length - length / 2 - 1).toInteger())}"