Gtk.TextBuffer.prototype.get_line_count

function get_line_count():Number {
    // Gjs wrapper for gtk_text_buffer_get_line_count()
}

Obtains the number of lines in the buffer. This value is cached, so the function is very fast.

Returns

number of lines in the buffer