JAL-4061 tests, bugfixes and TODOs for matching feature(s) and descriptions incrementally
[jalview.git] / src / jalview / analysis / Finder.java
index ee296d7..181cc9f 100644 (file)
@@ -387,6 +387,7 @@ public class Finder implements FinderI
       {
         if (matchFeatureDesc)
         {
+          // TODO - record last matched
           matched = searchSequenceFeatures(residueIndex, searchPattern);
         }
         residueIndex = Integer.MAX_VALUE;
@@ -556,6 +557,8 @@ public class Finder implements FinderI
    * sequence to the list of match ids, (but not as a duplicate). Answers true
    * if a match was added, else false.
    * 
+   * TODO: allow incremental searching (ie next feature matched after last)
+   * 
    * @param seq
    * @param searchPattern
    * @return
@@ -571,8 +574,7 @@ public class Finder implements FinderI
       if (searchPattern.search(feature.type) || (feature.description != null
               && searchPattern.search(feature.description)))
       {
-        searchResults.addResult(seq, seq.findIndex(feature.getBegin()),
-                seq.findIndex(feature.getEnd()));
+        searchResults.addResult(seq, feature.getBegin(), feature.getEnd());
         matched = true;
       }
     }