mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Remove redundant condition
This commit is contained in:
+7
-9
@@ -102,15 +102,13 @@ public abstract class JavaLikeLangLineIndentProvider extends FormatterBasedLineI
|
||||
|
||||
@Nullable
|
||||
private static String getIndentString(@NotNull Project project, @NotNull Editor editor, int offset, Type indentType) {
|
||||
if (project != null) {
|
||||
Document document = editor.getDocument();
|
||||
String lastLineIndent = getLastLineIndent(document.getCharsSequence(), offset);
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
|
||||
if (file != null) {
|
||||
CommonCodeStyleSettings.IndentOptions options = CodeStyleSettingsManager.getSettings(project).getIndentOptionsByFile(file);
|
||||
return
|
||||
lastLineIndent + new IndentInfo(0, indentTypeToSize(indentType, options), 0, false).generateNewWhiteSpace(options);
|
||||
}
|
||||
Document document = editor.getDocument();
|
||||
String lastLineIndent = getLastLineIndent(document.getCharsSequence(), offset);
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
|
||||
if (file != null) {
|
||||
CommonCodeStyleSettings.IndentOptions options = CodeStyleSettingsManager.getSettings(project).getIndentOptionsByFile(file);
|
||||
return
|
||||
lastLineIndent + new IndentInfo(0, indentTypeToSize(indentType, options), 0, false).generateNewWhiteSpace(options);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user