TextBuffer.getIterAtLineIndex

Obtains an iterator pointing to byte_index within the given line. byte_index must be the start of a UTF-8 character. Note bytes, not characters; UTF-8 may encode one character as multiple bytes.

Before the 3.20 version, it was not allowed to pass an invalid location.

Since the 3.20 version, if line_number is greater than the number of lines in the buffer, the end iterator is returned. And if byte_index is off the end of the line, the iterator at the end of the line is returned.

class TextBuffer
void
getIterAtLineIndex

Parameters

iter TextIter

iterator to initialize

lineNumber int

line number counting from 0

byteIndex int

byte index from start of line