IDEA-90457 Wrapping inserts two line breaks instead of one

Correct tab-less string processing
This commit is contained in:
Denis.Zhdanov
2012-08-22 23:27:24 +04:00
parent 0d3fae35e9
commit ca387d7ee3
2 changed files with 2 additions and 0 deletions
@@ -39,6 +39,7 @@ public class JavaFormatterInEditorTest extends LightPlatformCodeInsightTestCase
"\n" +
"class <caret>Test {\n" +
"}",
"import static java.util.concurrent\n" +
" .atomic.AtomicInteger.*;\n" +
"\n" +
@@ -342,6 +342,7 @@ public class CodeFormatterFacade {
if (!hasTabs) {
if (Math.min(endLineOffset, endOffsetToUse) - startLineOffset > mySettings.RIGHT_MARGIN) {
preferredWrapPosition = startLineOffset + mySettings.RIGHT_MARGIN - FormatConstants.RESERVED_LINE_WRAP_WIDTH_IN_COLUMNS;
wrapLine = true;
}
}
else if (canOptimize) {