forked from qt-creator/qt-creator
TextEditor: Do not make one-letter doxygen commands end a rewrap region
In 8e118e9d5e, we stopped re-wrapping in
comments when a doxygen/qdoc command appeared at the start of the line.
However, there are also "inline" commands such as \l and \c that can by
chance appear on the start of a line and should not stop rewrapping.
Since we are still quite reluctant to enumerate and categorize the
countless doxygen/qdoc commands, let's just ignore all one-letter
commands for rewrapping purposes.
(Yes, this is another hacky heuristic.)
Fixes: QTCREATORBUG-28761
Change-Id: I40d77706851ec24504d6fd8795906dd55249661d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -7638,7 +7638,7 @@ void TextEditorWidget::rewrapParagraph()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find end of paragraph.
|
// Find end of paragraph.
|
||||||
const QRegularExpression immovableDoxygenCommand(doxygenPrefix + "[@\\\\].*");
|
const QRegularExpression immovableDoxygenCommand(doxygenPrefix + "[@\\\\][a-zA-Z]{2,}");
|
||||||
QTC_CHECK(immovableDoxygenCommand.isValid());
|
QTC_CHECK(immovableDoxygenCommand.isValid());
|
||||||
while (cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor)) {
|
while (cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor)) {
|
||||||
QString text = cursor.block().text();
|
QString text = cursor.block().text();
|
||||||
|
|||||||
Reference in New Issue
Block a user