Get the line number from character position.
$cur_line = $scintilla->line_from_position($scintilla->get_current_pos());