forked from qt-creator/qt-creator
C++: Avoid trying to generate Doxygen when at end of file
Change-Id: I1fc126782bd88dd65ff83f50fc1dcf65e51a37ff Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
This commit is contained in:
@@ -2307,16 +2307,18 @@ bool CPPEditorWidget::handleDocumentationComment(QKeyEvent *e)
|
||||
&& cursor.movePosition(QTextCursor::NextCharacter)) {
|
||||
}
|
||||
|
||||
const QString &comment = doxygen.generate(cursor);
|
||||
if (!comment.isEmpty()) {
|
||||
cursor.beginEditBlock();
|
||||
cursor.setPosition(pos);
|
||||
cursor.insertText(comment);
|
||||
cursor.setPosition(pos - 3, QTextCursor::KeepAnchor);
|
||||
indent(document(), cursor, QChar::Null);
|
||||
cursor.endEditBlock();
|
||||
e->accept();
|
||||
return true;
|
||||
if (!cursor.atEnd()) {
|
||||
const QString &comment = doxygen.generate(cursor);
|
||||
if (!comment.isEmpty()) {
|
||||
cursor.beginEditBlock();
|
||||
cursor.setPosition(pos);
|
||||
cursor.insertText(comment);
|
||||
cursor.setPosition(pos - 3, QTextCursor::KeepAnchor);
|
||||
indent(document(), cursor, QChar::Null);
|
||||
cursor.endEditBlock();
|
||||
e->accept();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cursor.setPosition(pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user