diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2007-05-24 23:21:32 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2007-05-24 23:21:32 +0000 |
commit | 28f82bf5686823d1e331d16704e683d906d287e5 (patch) | |
tree | 78c91de87694e795a5caa8c81b29b1dcb427f0b0 /src/xdisp.c | |
parent | 8fc8506f84a8fa36476dadd8f0539a38edc4a5cd (diff) | |
download | emacs-28f82bf5686823d1e331d16704e683d906d287e5.tar.gz |
(redisplay_window): If first window line is a continuation line,
recompute the new window start instead of recentering.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 82f24551f19..a50018f1596 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12968,6 +12968,8 @@ redisplay_window (window, just_this_one_p) w->force_start = Qt; } + force_start: + /* Handle case where place to start displaying has been specified, unless the specified location is outside the accessible range. */ if (!NILP (w->force_start) @@ -13147,39 +13149,15 @@ redisplay_window (window, just_this_one_p) than a simple mouse-click. */ if (NILP (w->start_at_line_beg) && NILP (do_mouse_tracking) - && CHARPOS (startp) > BEGV) + && CHARPOS (startp) > BEGV + && CHARPOS (startp) > BEG + save_beg_unchanged + && CHARPOS (startp) <= Z - save_end_unchanged) { -#if 0 - /* The following code tried to make BEG_UNCHANGED and - END_UNCHANGED up to date (similar to try_window_id). - Is it important to do so? - - The trouble is that it's a little too strict when it - comes to overlays: modify_overlay can call - BUF_COMPUTE_UNCHANGED, which alters BUF_BEG_UNCHANGED and - BUF_END_UNCHANGED directly without moving the gap. - - This can result in spurious recentering when overlays are - altered in the buffer. So unless it's proven necessary, - let's leave this commented out for now. -- cyd. */ - if (MODIFF > SAVE_MODIFF - || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE) - { - if (GPT - BEG < BEG_UNCHANGED) - BEG_UNCHANGED = GPT - BEG; - if (Z - GPT < END_UNCHANGED) - END_UNCHANGED = Z - GPT; - } -#endif - - if (CHARPOS (startp) > BEG + save_beg_unchanged - && CHARPOS (startp) <= Z - save_end_unchanged) - { - /* There doesn't seems to be a simple way to find a new - window start that is near the old window start, so - we just recenter. */ - goto recenter; - } + w->force_start = Qt; + if (XMARKER (w->start)->buffer == current_buffer) + compute_window_start_on_continuation_line (w); + SET_TEXT_POS_FROM_MARKER (startp, w->start); + goto force_start; } #if GLYPH_DEBUG |