After performing an action such as undo/redo, we need to actually scroll
to the position where the operation occurred.
I do note that the scroll here seems to often get invalidated if it is
pages away, and we never make the full scroll. But I've seen this all over
the place elsewhere too and that needs to be handled, most likely, as a
more comprehensive fix for scrolling during line validation.
Related #4575
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
if (gtk_text_view_get_editable (text_view))
- gtk_text_buffer_undo (text_view->priv->buffer);
+ {
+ gtk_text_buffer_undo (text_view->priv->buffer);
+ gtk_text_view_scroll_mark_onscreen (text_view,
+ gtk_text_buffer_get_insert (text_view->priv->buffer));
+ }
}
static void
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
if (gtk_text_view_get_editable (text_view))
- gtk_text_buffer_redo (text_view->priv->buffer);
+ {
+ gtk_text_buffer_redo (text_view->priv->buffer);
+ gtk_text_view_scroll_mark_onscreen (text_view,
+ gtk_text_buffer_get_insert (text_view->priv->buffer));
+ }
}
static void