forked from qt-creator/qt-creator
CppEditor: Fix doxygen continuation
... for the case where the cursor is on the first line of the comment. At this point, we have just found out that no initial skeleton is to be created and that we want to do a continuation instead. Therefore, we need to rewind the cursor position, so handleDoxygenContinuation() will receive the original cursor. Fixes: QTCREATORBUG-20677 Change-Id: I42f1b83df624a9833fe13e1fa01e41c5c6c45334 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -323,6 +323,7 @@ bool trySplitComment(TextEditor::TextEditorWidget *editorWidget,
|
|||||||
cursor.endEditBlock();
|
cursor.endEditBlock();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
cursor.setPosition(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // right after first doxygen comment
|
} // right after first doxygen comment
|
||||||
|
@@ -81,6 +81,21 @@ void DoxygenTest::testBasic_data()
|
|||||||
"int a;\n"
|
"int a;\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
QTest::newRow("qt_style_cursor_before_existing_comment") << _(
|
||||||
|
"bool preventFolding;\n"
|
||||||
|
"/*!|\n"
|
||||||
|
" * \\brief something\n"
|
||||||
|
" */\n"
|
||||||
|
"int a;\n"
|
||||||
|
) << _(
|
||||||
|
"bool preventFolding;\n"
|
||||||
|
"/*!\n"
|
||||||
|
" * \n"
|
||||||
|
" * \\brief something\n"
|
||||||
|
" */\n"
|
||||||
|
"int a;\n"
|
||||||
|
);
|
||||||
|
|
||||||
QTest::newRow("qt_style_continuation") << _(
|
QTest::newRow("qt_style_continuation") << _(
|
||||||
"bool preventFolding;\n"
|
"bool preventFolding;\n"
|
||||||
"/*!\n"
|
"/*!\n"
|
||||||
|
Reference in New Issue
Block a user