comparison src/xdisp.c @ 70119:aebb8898adb3

(redisplay_window): If current window start is not at the beginning of a line, select a new window start if buffer is modified and window start is in the modified region, but the first change is before window start.
author Kim F. Storm <storm@cua.dk>
date Wed, 19 Apr 2006 23:20:21 +0000
parents 585153d15846
children 59e9f1a3c6f1
comparison
equal deleted inserted replaced
70118:171d2c3be825 70119:aebb8898adb3
12858 /* Avoid starting at end of buffer. */ 12858 /* Avoid starting at end of buffer. */
12859 || CHARPOS (startp) == BEGV 12859 || CHARPOS (startp) == BEGV
12860 || (XFASTINT (w->last_modified) >= MODIFF 12860 || (XFASTINT (w->last_modified) >= MODIFF
12861 && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF))) 12861 && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF)))
12862 { 12862 {
12863
12864 /* If first window line is a continuation line, and window start
12865 is inside the modified region, but the first change is before
12866 current window start, we must select a new window start.*/
12867 if (NILP (w->start_at_line_beg))
12868 {
12869 /* Make sure beg_unchanged and end_unchanged are up to date.
12870 Do it only if buffer has really changed. This may or may
12871 not have been done by try_window_id (see which) already. */
12872 if (MODIFF > SAVE_MODIFF
12873 /* This seems to happen sometimes after saving a buffer. */
12874 || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE)
12875 {
12876 if (GPT - BEG < BEG_UNCHANGED)
12877 BEG_UNCHANGED = GPT - BEG;
12878 if (Z - GPT < END_UNCHANGED)
12879 END_UNCHANGED = Z - GPT;
12880 }
12881
12882 if (CHARPOS (startp) > BEG + BEG_UNCHANGED
12883 && CHARPOS (startp) <= Z - END_UNCHANGED)
12884 {
12885 centering_position = 0;
12886 goto recenter;
12887 }
12888 }
12889
12863 #if GLYPH_DEBUG 12890 #if GLYPH_DEBUG
12864 debug_method_add (w, "same window start"); 12891 debug_method_add (w, "same window start");
12865 #endif 12892 #endif
12866 12893
12867 /* Try to redisplay starting at same place as before. 12894 /* Try to redisplay starting at same place as before.