From b64b39804050021b9147a30fb67d79eba8df157c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 1 Apr 1994 02:10:14 +0000 Subject: [PATCH] (adjust_window_charstarts): New function. (direct_output_for_insert): Call it. --- src/dispnew.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/dispnew.c b/src/dispnew.c index c4d9b2ec364..887fbc81cbb 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -892,6 +892,33 @@ preserve_my_columns (w) #endif +/* Adjust by ADJUST the charstart values in window W + before vpos VPOS, which counts relative to the frame + (not relative to W itself). */ + +void +adjust_window_charstarts (w, vpos, adjust) + struct window *w; + int vpos; + int adjust; +{ + int left = XFASTINT (w->left); + int top = XFASTINT (w->top); + int right = left + window_internal_height (w); + int height = window_internal_height (w); + int i; + + for (i = vpos + 1; i < top + height; i++) + { + int *charstart + = FRAME_CURRENT_GLYPHS (XFRAME (WINDOW_FRAME (w)))->charstarts[i]; + int j; + for (j = left; j < right; j++) + if (charstart[j] > 0) + charstart[j] += adjust; + } +} + /* On discovering that the redisplay for a window was no good, cancel the columns of that window, so that when the window is displayed over again get_display_line will not complain. */ @@ -979,6 +1006,7 @@ direct_output_for_insert (g) #endif current_frame->glyphs[vpos][hpos] = MAKE_GLYPH (frame, g, face); current_frame->charstarts[vpos][hpos] = point; + adjust_window_charstarts (w, vpos, 1); } unchanged_modified = MODIFF; beg_unchanged = GPT - BEG; -- 2.39.5