forked from qt-creator/qt-creator
ClangFormat: Prepend a space character to our inserted line comment
Otherwise, we could introduce unwanted syntactical constructs, for instance if the previous character is an asterisk. Fixes: QTCREATORBUG-25966 Change-Id: Ic0b535861bc1cb4f5f93d06bb11d0f3c7c583893 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -301,7 +301,7 @@ int forceIndentWithExtraText(QByteArray &buffer,
|
|||||||
const int prevEndOffset = Utils::Text::utf8NthLineOffset(block.document(), buffer,
|
const int prevEndOffset = Utils::Text::utf8NthLineOffset(block.document(), buffer,
|
||||||
block.blockNumber()) + block.previous().text().length();
|
block.blockNumber()) + block.previous().text().length();
|
||||||
buffer.insert(prevEndOffset, " //");
|
buffer.insert(prevEndOffset, " //");
|
||||||
extraLength += 2;
|
extraLength += 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
buffer.insert(utf8Offset + extraLength, dummyText);
|
buffer.insert(utf8Offset + extraLength, dummyText);
|
||||||
|
@@ -957,7 +957,7 @@ TEST_F(ClangFormat, ChainedMemberFunctionCalls)
|
|||||||
" .func();"));
|
" .func();"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ClangFormat, DISABLED_CommentBlock)
|
TEST_F(ClangFormat, CommentBlock)
|
||||||
{
|
{
|
||||||
insertLines({"/****************************************************************************",
|
insertLines({"/****************************************************************************",
|
||||||
"**",
|
"**",
|
||||||
|
Reference in New Issue
Block a user