How do I scroll a TextView to display the text being inserted?
When inserting text using insert_at_custor(), it may happen that the text inserted surpasses the textview’s current viewport, and requires scrolling. Gustavo Carneiro and Mikoyan wrote in to suggest using the textbuffer’s scroll_to_mark() method, which scrolls to a certain point in the buffer. You can use the get_insert() method to return the current insert position right after inserting if you want to make sure you scroll to the end of the text.