changeset 2874:80805283464a

* xdisp.c (redisplay_window): Make the scrollbar reflect the extent of the visible region, not the whole buffer.
author Jim Blandy <jimb@redhat.com>
date Tue, 18 May 1993 22:45:53 +0000
parents f1cd54cf1b67
children cd410e9ac4ab
files src/xdisp.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Tue May 18 22:45:29 1993 +0000
+++ b/src/xdisp.c	Tue May 18 22:45:53 1993 +0000
@@ -1060,6 +1060,11 @@
       int start, end, whole;
 
       /* Calculate the start and end positions for the current window.
+	 At some point, it would be nice to choose between scrollbars
+	 which reflect the whole buffer size, with special markers
+	 indicating narrowing, and scrollbars which reflect only the
+	 visible region.
+
 	 Note that minibuffers sometimes aren't displaying any text.  */
       if (! MINI_WINDOW_P (w)
 	  || (w == XWINDOW (minibuf_window) && ! echo_area_glyphs))
@@ -1068,7 +1073,10 @@
 	  /* I don't think this is guaranteed to be right.  For the
 	     moment, we'll pretend it is.  */
 	  end = Z - XINT (w->window_end_pos);
-	  whole = Z - BEG;
+	  whole = ZV - BEGV;
+
+	  if (end < start) end = start;
+	  if (whole > (end - start)) whole = end - start;
 	}
       else
 	start = end = whole = 0;