Index: gtk/gtktextview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextview.c,v
retrieving revision 1.316
diff -u -p -r1.316 gtktextview.c
--- gtk/gtktextview.c	29 May 2006 08:39:00 -0000	1.316
+++ gtk/gtktextview.c	14 Jun 2006 13:55:49 -0000
@@ -3127,11 +3127,21 @@ gtk_text_view_size_allocate (GtkWidget *
    */
   gtk_text_view_flush_first_validate (text_view);
 
-  /* widget->window doesn't get auto-redrawn as the layout is computed, so has to
-   * be invalidated
-   */
   if (size_changed && GTK_WIDGET_REALIZED (widget))
-    gdk_window_invalidate_rect (widget->window, NULL, FALSE);
+    {
+      GtkTextBuffer *buffer;
+
+      /* widget->window doesn't get auto-redrawn as the layout is
+       * computed, so has to be invalidated
+       */
+      gdk_window_invalidate_rect (widget->window, NULL, FALSE);
+
+      /* keep cursor visible */
+      buffer = get_buffer (text_view);
+      gtk_text_view_scroll_to_mark (text_view,
+                                    gtk_text_buffer_get_mark (buffer, "insert"),
+                                    0.0, FALSE, 0.0, 0.0);
+    }
 }
 
 static void
