forked from qt-creator/qt-creator
texteditor: Add Select Next Match respect find settings
To increase the usefullness of the function, this change adds the current search settings to the find() call. This way the "case sensitive" and "whole words only" is taken into account when searching for the next occurrence of the selected text. Change-Id: Ia4b28e84c39b9298d2dcbfa381ccf19d8137bfc6 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -6781,9 +6781,11 @@ void TextEditorWidgetPrivate::addSelectionNextFindMatch()
|
||||
return;
|
||||
}
|
||||
|
||||
const QTextDocument::FindFlags findFlags = textDocumentFlagsForFindFlags(m_findFlags);
|
||||
|
||||
int searchFrom = cursors.last().selectionEnd();
|
||||
while (true) {
|
||||
QTextCursor next = document->find(selection.toPlainText(), searchFrom);
|
||||
QTextCursor next = document->find(selection.toPlainText(), searchFrom, findFlags);
|
||||
if (next.isNull()) {
|
||||
searchFrom = 0;
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user