forked from qt-creator/qt-creator
CppEditor: Simplify handling of comment splitting
Change-Id: I9a6e4962b52321313bb80cc3c3a77fac80aa0536 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -110,8 +110,6 @@ public:
|
||||
CppEditorDocument *m_cppEditorDocument;
|
||||
CppEditorOutline *m_cppEditorOutline;
|
||||
|
||||
CppDocumentationCommentHelper m_cppDocumentationCommentHelper;
|
||||
|
||||
QTimer m_updateFunctionDeclDefLinkTimer;
|
||||
|
||||
CppLocalRenaming m_localRenaming;
|
||||
@@ -132,7 +130,6 @@ CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
|
||||
: m_modelManager(CppModelManager::instance())
|
||||
, m_cppEditorDocument(qobject_cast<CppEditorDocument *>(q->textDocument()))
|
||||
, m_cppEditorOutline(new CppEditorOutline(q))
|
||||
, m_cppDocumentationCommentHelper(q)
|
||||
, m_localRenaming(q)
|
||||
, m_useSelectionsUpdater(q)
|
||||
, m_declDefLinkFinder(new FunctionDeclDefLinkFinder(q))
|
||||
@@ -541,8 +538,12 @@ void CppEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
if (handleStringSplitting(e))
|
||||
return;
|
||||
|
||||
if (d->m_cppDocumentationCommentHelper.handleKeyPressEvent(e))
|
||||
return;
|
||||
if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
|
||||
if (trySplitComment(this)) {
|
||||
e->accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
TextEditorWidget::keyPressEvent(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user