mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
(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.
This commit is contained in:
parent
7f32b80b11
commit
e221c49a0a
1 changed files with 27 additions and 0 deletions
27
src/xdisp.c
27
src/xdisp.c
|
|
@ -12860,6 +12860,33 @@ redisplay_window (window, just_this_one_p)
|
||||||
|| (XFASTINT (w->last_modified) >= MODIFF
|
|| (XFASTINT (w->last_modified) >= MODIFF
|
||||||
&& XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF)))
|
&& XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF)))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/* If first window line is a continuation line, and window start
|
||||||
|
is inside the modified region, but the first change is before
|
||||||
|
current window start, we must select a new window start.*/
|
||||||
|
if (NILP (w->start_at_line_beg))
|
||||||
|
{
|
||||||
|
/* Make sure beg_unchanged and end_unchanged are up to date.
|
||||||
|
Do it only if buffer has really changed. This may or may
|
||||||
|
not have been done by try_window_id (see which) already. */
|
||||||
|
if (MODIFF > SAVE_MODIFF
|
||||||
|
/* This seems to happen sometimes after saving a buffer. */
|
||||||
|
|| BEG_UNCHANGED + END_UNCHANGED > Z_BYTE)
|
||||||
|
{
|
||||||
|
if (GPT - BEG < BEG_UNCHANGED)
|
||||||
|
BEG_UNCHANGED = GPT - BEG;
|
||||||
|
if (Z - GPT < END_UNCHANGED)
|
||||||
|
END_UNCHANGED = Z - GPT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CHARPOS (startp) > BEG + BEG_UNCHANGED
|
||||||
|
&& CHARPOS (startp) <= Z - END_UNCHANGED)
|
||||||
|
{
|
||||||
|
centering_position = 0;
|
||||||
|
goto recenter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if GLYPH_DEBUG
|
#if GLYPH_DEBUG
|
||||||
debug_method_add (w, "same window start");
|
debug_method_add (w, "same window start");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue