SourceSearchContext.getOccurrencePosition

Gets the position of a search occurrence. If the buffer is not already fully scanned, the position may be unknown, and -1 is returned. If 0 is returned, it means that this part of the buffer has already been scanned, and that @match_start and @match_end don't delimit an occurrence.

class SourceSearchContext
int
getOccurrencePosition

Parameters

matchStart TextIter

the start of the occurrence.

matchEnd TextIter

the end of the occurrence.

Return: the position of the search occurrence. The first occurrence has the position 1 (not 0). Returns 0 if @match_start and @match_end don't delimit an occurrence. Returns -1 if the position is not yet known.

Meta

Since

3.10