mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Line indent provider: more cases fixed
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
+2
-1
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user