summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/xtext.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index 6151f5b6..6691277e 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -4964,6 +4964,14 @@ gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render)
 	dontscroll (buf);	/* force scrolling off */
 	xtext->adj->value = buf->old_value;
 	xtext->adj->upper = buf->num_lines;
+
+	/* if the scrollbar was down, keep it down */
+	if (xtext->buffer->scrollbar_down && xtext->adj->value <
+		xtext->adj->upper - xtext->adj->page_size)
+	{
+		xtext->adj->value = xtext->adj->upper - xtext->adj->page_size;
+	}
+
 	if (xtext->adj->upper == 0)
 		xtext->adj->upper = 1;
 	/* sanity check */