Line indent provider: more cases fixed

This commit is contained in:
Rustam Vishnyakov
2016-06-03 15:15:34 +03:00
parent 22591d5482
commit 3b10a45eae
2 changed files with 3 additions and 2 deletions
@@ -165,7 +165,7 @@ public abstract class SemanticEditorPosition {
public boolean isAtLanguage(@Nullable Language language) {
if (language != null && !myIterator.atEnd()) {
return myIterator.getTokenType().getLanguage().is(language);
return language== Language.ANY || myIterator.getTokenType().getLanguage().is(language);
}
return false;
}
@@ -164,10 +164,11 @@ public abstract class JavaLikeLangLineIndentProvider extends FormatterBasedLineI
position.beforeParentheses(LeftParenthesis, RightParenthesis);
}
while (!position.isAtEnd()) {
if (currLanguage == Language.ANY || currLanguage == null) currLanguage = position.getLanguage();
if (position.isAt(Semicolon) ||
position.isAt(BlockOpeningBrace) ||
position.isAt(BlockClosingBrace) ||
!position.isAtLanguage(currLanguage)) {
! ((position.getLanguage() != Language.ANY) && position.isAtLanguage(currLanguage))) {
SemanticEditorPosition statementStart = getPosition(position.getEditor(), position.getStartOffset());
if (statementStart.after().isAt(Whitespace) && statementStart.isAtMultiline()) {
if (!statementStart.after().isAtEnd()) {