Changeset View
Changeset View
Standalone View
Standalone View
src/vimode/searcher.cpp
Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Line(s) | 176 | while (true) { | |||
---|---|---|---|---|---|
179 | if (matchesUnfiltered.size() == 1 && !matchesUnfiltered.first().isValid()) { | 179 | if (matchesUnfiltered.size() == 1 && !matchesUnfiltered.first().isValid()) { | ||
180 | break; | 180 | break; | ||
181 | } | 181 | } | ||
182 | 182 | | |||
183 | // After sorting, the last element in matchesUnfiltered is the last match position. | 183 | // After sorting, the last element in matchesUnfiltered is the last match position. | ||
184 | std::sort(matchesUnfiltered.begin(), matchesUnfiltered.end()); | 184 | std::sort(matchesUnfiltered.begin(), matchesUnfiltered.end()); | ||
185 | 185 | | |||
186 | QVector<KTextEditor::Range> filteredMatches; | 186 | QVector<KTextEditor::Range> filteredMatches; | ||
187 | foreach (KTextEditor::Range unfilteredMatch, matchesUnfiltered) { | 187 | for (KTextEditor::Range unfilteredMatch : qAsConst(matchesUnfiltered)) { | ||
188 | if (unfilteredMatch.start() < searchBegin) { | 188 | if (unfilteredMatch.start() < searchBegin) { | ||
189 | filteredMatches.append(unfilteredMatch); | 189 | filteredMatches.append(unfilteredMatch); | ||
190 | } | 190 | } | ||
191 | } | 191 | } | ||
192 | if (!filteredMatches.isEmpty()) { | 192 | if (!filteredMatches.isEmpty()) { | ||
193 | // Want the latest matching range that is before searchBegin. | 193 | // Want the latest matching range that is before searchBegin. | ||
194 | bestMatch = filteredMatches.last(); | 194 | bestMatch = filteredMatches.last(); | ||
195 | break; | 195 | break; | ||
Show All 27 Lines |