forked from qt-creator/qt-creator
ClangFormat: Improve dummy text guessing for empty lines
Improve detection of the cases when the empty line is inside the parenthesis to get more proper indentation. Change-Id: I4aa37c29b17bedcd0e4a781d12c7066e818a07f3 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -391,6 +391,19 @@ TEST_F(ClangFormat, IndentAfterExtraSpaceInpreviousLine)
|
||||
" && b)"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, IndentEmptyLineInsideParantheses)
|
||||
{
|
||||
insertLines({"if (a ",
|
||||
"",
|
||||
" && b)"});
|
||||
|
||||
indenter.indentBlock(doc.findBlockByNumber(1), QChar::Null, TextEditor::TabSettings());
|
||||
|
||||
ASSERT_THAT(documentLines(), ElementsAre("if (a",
|
||||
" ",
|
||||
" && b)"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, IndentFunctionBodyButNotFormatBeforeIt)
|
||||
{
|
||||
insertLines({"int foo(int a, int b,",
|
||||
|
||||
Reference in New Issue
Block a user