aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-05-18 22:45:53 +0000
committerJim Blandy1993-05-18 22:45:53 +0000
commit3505ea701237ad94d57200cd4ba6bc768a8eef3d (patch)
treefd3f1c6395a367055c2cb4c1347974aa2c3b9135
parent1334b321d60d0ce12936fb5f50ad621e9308e0f0 (diff)
downloademacs-3505ea701237ad94d57200cd4ba6bc768a8eef3d.tar.gz
emacs-3505ea701237ad94d57200cd4ba6bc768a8eef3d.zip
* xdisp.c (redisplay_window): Make the scrollbar reflect the
extent of the visible region, not the whole buffer.
-rw-r--r--src/xdisp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index ba33e111387..562e10aafbd 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1060,6 +1060,11 @@ done:
1060 int start, end, whole; 1060 int start, end, whole;
1061 1061
1062 /* Calculate the start and end positions for the current window. 1062 /* Calculate the start and end positions for the current window.
1063 At some point, it would be nice to choose between scrollbars
1064 which reflect the whole buffer size, with special markers
1065 indicating narrowing, and scrollbars which reflect only the
1066 visible region.
1067
1063 Note that minibuffers sometimes aren't displaying any text. */ 1068 Note that minibuffers sometimes aren't displaying any text. */
1064 if (! MINI_WINDOW_P (w) 1069 if (! MINI_WINDOW_P (w)
1065 || (w == XWINDOW (minibuf_window) && ! echo_area_glyphs)) 1070 || (w == XWINDOW (minibuf_window) && ! echo_area_glyphs))
@@ -1068,7 +1073,10 @@ done:
1068 /* I don't think this is guaranteed to be right. For the 1073 /* I don't think this is guaranteed to be right. For the
1069 moment, we'll pretend it is. */ 1074 moment, we'll pretend it is. */
1070 end = Z - XINT (w->window_end_pos); 1075 end = Z - XINT (w->window_end_pos);
1071 whole = Z - BEG; 1076 whole = ZV - BEGV;
1077
1078 if (end < start) end = start;
1079 if (whole > (end - start)) whole = end - start;
1072 } 1080 }
1073 else 1081 else
1074 start = end = whole = 0; 1082 start = end = whole = 0;