mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Detect continuation indent only if last opened brace is "("
This commit is contained in:
+2
-2
@@ -60,10 +60,10 @@ class ContinuationIndentDetector {
|
||||
}
|
||||
|
||||
public boolean isContinuationIndent() {
|
||||
if (myIncorrectBracketsOrder) {
|
||||
if (myIncorrectBracketsOrder || myOpenedBrackets.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return myOpenedBrackets.contains(Bracket.LPARENTH);
|
||||
return myOpenedBrackets.peek() == Bracket.LPARENTH;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -101,7 +101,7 @@ public class ContinuationIndentDetectorTest extends TestCase {
|
||||
" }\n" +
|
||||
"}"
|
||||
);
|
||||
doCheckLinesWithContinuationIndents(7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
|
||||
doCheckLinesWithContinuationIndents(11, 16);
|
||||
}
|
||||
|
||||
public void testClosingBracesAtLineStart() {
|
||||
@@ -127,7 +127,7 @@ public class ContinuationIndentDetectorTest extends TestCase {
|
||||
" )}\n" +
|
||||
")\n" +
|
||||
"class T {}");
|
||||
doCheckLinesWithContinuationIndents(1, 2, 3, 4, 5, 6);
|
||||
doCheckLinesWithContinuationIndents(1, 2, 4, 5, 6);
|
||||
}
|
||||
|
||||
private void doCheckLinesWithContinuationIndents(Integer... linesWithContinuationIndents) {
|
||||
|
||||
Reference in New Issue
Block a user