diff --git a/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp b/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp index 7014c57bede..9e61b0c91a6 100644 --- a/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp +++ b/src/plugins/cppeditor/cppdocumentationcommenthelper.cpp @@ -323,6 +323,7 @@ bool trySplitComment(TextEditor::TextEditorWidget *editorWidget, cursor.endEditBlock(); return true; } + cursor.setPosition(pos); } } } // right after first doxygen comment diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp index 9fc6f1575c1..9511b6df6e6 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.cpp +++ b/src/plugins/cppeditor/cppdoxygen_test.cpp @@ -81,6 +81,21 @@ void DoxygenTest::testBasic_data() "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") << _( "bool preventFolding;\n" "/*!\n"