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:
@@ -300,8 +300,8 @@ int forceIndentWithExtraText(QByteArray &buffer,
|
||||
if (block.previous().isValid()) {
|
||||
const int prevEndOffset = Utils::Text::utf8NthLineOffset(block.document(), buffer,
|
||||
block.blockNumber()) + block.previous().text().length();
|
||||
buffer.insert(prevEndOffset, "//");
|
||||
extraLength += 2;
|
||||
buffer.insert(prevEndOffset, " //");
|
||||
extraLength += 3;
|
||||
}
|
||||
}
|
||||
buffer.insert(utf8Offset + extraLength, dummyText);
|
||||
|
@@ -957,7 +957,7 @@ TEST_F(ClangFormat, ChainedMemberFunctionCalls)
|
||||
" .func();"));
|
||||
}
|
||||
|
||||
TEST_F(ClangFormat, DISABLED_CommentBlock)
|
||||
TEST_F(ClangFormat, CommentBlock)
|
||||
{
|
||||
insertLines({"/****************************************************************************",
|
||||
"**",
|
||||
|
Reference in New Issue
Block a user