Gtk.TextBuffer.prototype.get_iter_at_line_index

function get_iter_at_line_index(line_number:Number, byte_index:Number):void {
    // Gjs wrapper for gtk_text_buffer_get_iter_at_line_index()
}

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

line_number

line number counting from 0

byte_index

byte index from start of line