X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FFinder.java;h=d52e42a768a0e65db9a543e05031e5a5a164de6f;hb=92e5bdb7399d549344f32bd16d87ab489ce19712;hp=5d42905ba40dad454a23b8c1e2ec0a4219cd6cd7;hpb=4016a0a5baf92cea3f1303fdaae3804244857427;p=jalview.git diff --git a/src/jalview/analysis/Finder.java b/src/jalview/analysis/Finder.java index 5d42905..d52e42a 100644 --- a/src/jalview/analysis/Finder.java +++ b/src/jalview/analysis/Finder.java @@ -164,14 +164,10 @@ public class Finder implements FinderI getSequence(ignoreHidden); boolean found = false; - while (!found || findAll) + while ((!found || findAll) && sequenceIndex < end) { found = findNextMatch(searchString, searchPattern, searchDescription, ignoreHidden); - if (sequenceIndex >= end) - { - break; - } } } @@ -421,7 +417,7 @@ public class Finder implements FinderI * update residueIndex to next position after the start of the match * (findIndex returns a value base 1, columnIndex is held base 0) */ - residueIndex += offset + 1; + residueIndex = searchPattern.matchedFrom()+1; /* * return false if the match is entirely in a hidden region @@ -475,10 +471,7 @@ public class Finder implements FinderI */ int[] truePositions = searchedSequenceMap .locateInFrom(matchStartPosition, matchEndPosition); - for (int i = 0; i < truePositions.length - 1; i += 2) - { - searchResults.addResult(seq, truePositions[i], truePositions[i + 1]); - } + searchResults.addResult(seq, truePositions); } /**