1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixed bug 299860.

This commit is contained in:
Sergey Prigogin 2010-01-17 06:50:33 +00:00
parent 59cc85a816
commit b4c4b327e2

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Andrey Eremchenko, kamre@ngs.ru - 222495 C/C++ search should show line matches and line numbers * Andrey Eremchenko, kamre@ngs.ru - 222495 C/C++ search should show line matches and line numbers
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.search; package org.eclipse.cdt.internal.ui.search;
@ -231,7 +232,7 @@ public class LineSearchElement extends PDOMSearchElement {
continue; continue;
} }
// compare offset of next match with current position // compare offset of next match with current position
if (nextMatchOffset > pos) if (nextMatchOffset > pos || nextMatch >= matches.length)
continue; continue;
// next match was reached // next match was reached
// check if this match is the first for current line // check if this match is the first for current line
@ -242,9 +243,6 @@ public class LineSearchElement extends PDOMSearchElement {
if (nextMatch < matches.length) { if (nextMatch < matches.length) {
// update offset of next match // update offset of next match
nextMatchOffset = matches[nextMatch].getOffset(); nextMatchOffset = matches[nextMatch].getOffset();
} else {
// no more matches
break;
} }
} }
// check if there were matches on the last line // check if there were matches on the last line