handleStartEndSequenceBackward method

int handleStartEndSequenceBackward(
  1. int ixLine,
  2. int ixStop
)

Handles a start stop sequence if the first (or last) line is matching. ixLine is the index of the first line to inspect. step: +1 or -1: signals forward or backward searching. ixStop is the the first "forbidden" index: reaching this index the search stops. Returns the number of lines belonging to the sequence.

Implementation

int handleStartEndSequenceBackward(int ixLine, int ixStop) {
  var rc = 1;
  while (ixLine != ixStop &&
      searcher.next(searcher.searchEngine.lineByIndex(ixLine),
              searcher.searchEngine.startColumnByIndex(ixLine)) ==
          null) {
    rc++;
    ixLine--;
  }
  return rc;
}