Commit d91d552c authored by Nikolai Kosjar's avatar Nikolai Kosjar Committed by David Schulz

CppEditor: Append extra ' ' in comment continuations

...for c style multiline comments and doxygens "///" and "//!".

Task-number: QTCREATORBUG-10856
Change-Id: I84a4f95ba9e676991484e45bb0f64be996ac3be9
Reviewed-by: default avatarUlf Hermann <ulf.hermann@digia.com>
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 0ed2f4e5
......@@ -170,7 +170,7 @@ void CppEditorPlugin::test_doxygen_comments_data()
"bool preventFolding;\n"
"/*!\n"
" * \\brief a\n"
" *\n"
" * \n"
" */\n"
"int a;\n"
);
......@@ -197,7 +197,7 @@ void CppEditorPlugin::test_doxygen_comments_data()
"bool preventFolding;\n"
"/**\n"
" * @brief a\n"
" *\n"
" * \n"
" */\n"
"int a;\n"
);
......@@ -236,7 +236,7 @@ void CppEditorPlugin::test_doxygen_comments_data()
"bool preventFolding;\n"
"///\n"
"/// \\brief a\n"
"///\n"
"/// \n"
"///\n"
"int a;\n"
);
......@@ -265,7 +265,7 @@ void CppEditorPlugin::test_doxygen_comments_data()
" bool preventFolding;\n"
" ///\n"
" /// \\brief a\n"
" ///\n"
" /// \n"
" ///\n"
" int a;\n"
);
......
......@@ -430,6 +430,7 @@ bool handleDoxygenCppStyleContinuation(QTextCursor &cursor,
const QString commentMarker = text.mid(offset, 3);
newLine.append(commentMarker);
newLine.append(QLatin1Char(' '));
cursor.insertText(newLine);
e->accept();
......@@ -481,12 +482,13 @@ bool handleDoxygenContinuation(QTextCursor &cursor,
c.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, offset);
newLine.append(c.selectedText());
if (text.at(offset) == QLatin1Char('/')) {
newLine.append(QLatin1String(" *"));
newLine.append(QLatin1String(" * "));
} else {
int start = offset;
while (offset < blockPos && text.at(offset) == QLatin1Char('*'))
++offset;
newLine.append(QString(offset - start, QLatin1Char('*')));
newLine.append(QLatin1Char(' '));
}
cursor.insertText(newLine);
e->accept();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment