previous method

  1. @override
int? previous(
  1. String line, [
  2. int? start
])
override

Looks for the previous current pattern. start: If null the whole line is inspected. Otherwise the search starts at this index Returns null if not found or the index of the hit.

Implementation

@override
int? previous(String line, [int? start]) {
  final rc = line.lastIndexOf(toSearch, start);
  searchEngine.lastMatch.type = LastMatchType.string;
  searchEngine.lastMatch.stringMatch = rc < 0 ? null : toSearch;
  searchEngine.lastMatch.position.column = rc;
  return rc < 0 ? null : rc;
}