diff options
| author | Andreas Schwab | 1998-04-29 09:46:49 +0000 |
|---|---|---|
| committer | Andreas Schwab | 1998-04-29 09:46:49 +0000 |
| commit | 84920a5cceccb3a57226656306677d86aaae33e6 (patch) | |
| tree | ae3f1e643e32616f33549b501267c6aee5bc8a2a /src | |
| parent | 9d1ec8314f7c46235b5231f860a22d8d3fbe600d (diff) | |
| download | emacs-84920a5cceccb3a57226656306677d86aaae33e6.tar.gz emacs-84920a5cceccb3a57226656306677d86aaae33e6.zip | |
(redisplay_window): Update STARTP_BYTE alongside with
STARTP. New variable scroll_margin_bytepos, to parallel
scroll_margin_pos. Fix arguments of pos_tab_offset to agree with
the first argument of compute_motion.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 2ac8e7d45b4..6df80a40560 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1952,6 +1952,7 @@ redisplay_window (window, just_this_one, preserve_echo_area) | |||
| 1952 | run_hook_with_args_2 (Qwindow_scroll_functions, window, | 1952 | run_hook_with_args_2 (Qwindow_scroll_functions, window, |
| 1953 | make_number (startp)); | 1953 | make_number (startp)); |
| 1954 | startp = marker_position (w->start); | 1954 | startp = marker_position (w->start); |
| 1955 | startp_byte = marker_byte_position (w->start); | ||
| 1955 | } | 1956 | } |
| 1956 | } | 1957 | } |
| 1957 | XSETFASTINT (w->last_modified, 0); | 1958 | XSETFASTINT (w->last_modified, 0); |
| @@ -2203,7 +2204,7 @@ redisplay_window (window, just_this_one, preserve_echo_area) | |||
| 2203 | && startp >= BEGV && startp <= ZV) | 2204 | && startp >= BEGV && startp <= ZV) |
| 2204 | { | 2205 | { |
| 2205 | int this_scroll_margin = scroll_margin; | 2206 | int this_scroll_margin = scroll_margin; |
| 2206 | int scroll_margin_pos; | 2207 | int scroll_margin_pos, scroll_margin_bytepos; |
| 2207 | 2208 | ||
| 2208 | /* Don't use a scroll margin that is negative or too large. */ | 2209 | /* Don't use a scroll margin that is negative or too large. */ |
| 2209 | if (this_scroll_margin < 0) | 2210 | if (this_scroll_margin < 0) |
| @@ -2217,14 +2218,19 @@ redisplay_window (window, just_this_one, preserve_echo_area) | |||
| 2217 | { | 2218 | { |
| 2218 | pos = *vmotion (scroll_margin_pos, -this_scroll_margin, w); | 2219 | pos = *vmotion (scroll_margin_pos, -this_scroll_margin, w); |
| 2219 | scroll_margin_pos = pos.bufpos; | 2220 | scroll_margin_pos = pos.bufpos; |
| 2221 | scroll_margin_bytepos = pos.bytepos; | ||
| 2220 | } | 2222 | } |
| 2223 | else | ||
| 2224 | scroll_margin_bytepos = CHAR_TO_BYTE (scroll_margin_pos); | ||
| 2225 | |||
| 2221 | if (PT >= scroll_margin_pos) | 2226 | if (PT >= scroll_margin_pos) |
| 2222 | { | 2227 | { |
| 2223 | struct position pos; | 2228 | struct position pos; |
| 2224 | pos = *compute_motion (scroll_margin_pos, 0, 0, 0, | 2229 | pos = *compute_motion (scroll_margin_pos, 0, 0, 0, |
| 2225 | PT, XFASTINT (w->height), 0, | 2230 | PT, XFASTINT (w->height), 0, |
| 2226 | XFASTINT (w->width), XFASTINT (w->hscroll), | 2231 | XFASTINT (w->width), XFASTINT (w->hscroll), |
| 2227 | pos_tab_offset (w, startp, startp_byte), | 2232 | pos_tab_offset (w, scroll_margin_pos, |
| 2233 | scroll_margin_bytepos), | ||
| 2228 | w); | 2234 | w); |
| 2229 | if (pos.vpos > scroll_conservatively) | 2235 | if (pos.vpos > scroll_conservatively) |
| 2230 | goto scroll_fail_1; | 2236 | goto scroll_fail_1; |
| @@ -2263,7 +2269,7 @@ redisplay_window (window, just_this_one, preserve_echo_area) | |||
| 2263 | pos = *compute_motion (PT, 0, 0, 0, | 2269 | pos = *compute_motion (PT, 0, 0, 0, |
| 2264 | scroll_margin_pos, XFASTINT (w->height), 0, | 2270 | scroll_margin_pos, XFASTINT (w->height), 0, |
| 2265 | XFASTINT (w->width), XFASTINT (w->hscroll), | 2271 | XFASTINT (w->width), XFASTINT (w->hscroll), |
| 2266 | pos_tab_offset (w, startp, startp_byte), | 2272 | pos_tab_offset (w, PT, PT_BYTE), |
| 2267 | w); | 2273 | w); |
| 2268 | if (pos.vpos > scroll_conservatively) | 2274 | if (pos.vpos > scroll_conservatively) |
| 2269 | goto scroll_fail_1; | 2275 | goto scroll_fail_1; |