forked from qt-creator/qt-creator
Utils: Add sorted() function
For simpler calling code. Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -7229,8 +7229,8 @@ void TextEditorWidget::autoIndent()
|
||||
MultiTextCursor cursor = multiTextCursor();
|
||||
cursor.beginEditBlock();
|
||||
// The order is important, since some indenter refer to previous indent positions.
|
||||
QList<QTextCursor> cursors = cursor.cursors();
|
||||
Utils::sort(cursors, [](const QTextCursor &lhs, const QTextCursor &rhs) {
|
||||
const QList<QTextCursor> cursors = Utils::sorted(cursor.cursors(),
|
||||
[](const QTextCursor &lhs, const QTextCursor &rhs) {
|
||||
return lhs.selectionStart() < rhs.selectionStart();
|
||||
});
|
||||
for (const QTextCursor &c : cursors)
|
||||
|
||||
Reference in New Issue
Block a user