aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-03 02:03:30 +0000
committerRichard M. Stallman1994-04-03 02:03:30 +0000
commit85bcef6cd02d1e81af35f5726fc09de551f0c841 (patch)
treea5c3135b68110883c376bcc786906d9b291fe4b1 /src
parent23b0200c6720b66efc40be80b49a27a320bffb8c (diff)
downloademacs-85bcef6cd02d1e81af35f5726fc09de551f0c841.tar.gz
emacs-85bcef6cd02d1e81af35f5726fc09de551f0c841.zip
(display_text_line): Always store in charstart
even if at endp. When clearing charstart, do the whole width. (redisplay): Call verify_charstarts. (redisplay): Don't call adjust_window_charstarts if on last text line of window.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 65340f57d0e..93ca88b4bdb 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -623,23 +623,26 @@ redisplay ()
623 if (cursor_vpos >= 0 && this_line_bufpos 623 if (cursor_vpos >= 0 && this_line_bufpos
624 && this_line_endpos == tlendpos) 624 && this_line_endpos == tlendpos)
625 { 625 {
626 int left = XFASTINT (w->left); 626 if (this_line_vpos < XFASTINT (w->top) + window_internal_height (w))
627 int *charstart_next_line 627 {
628 = FRAME_CURRENT_GLYPHS (XFRAME (WINDOW_FRAME (w)))->charstarts[this_line_vpos + 1]; 628 int left = XFASTINT (w->left);
629 int i; 629 int *charstart_next_line
630 int adjust; 630 = FRAME_CURRENT_GLYPHS (XFRAME (WINDOW_FRAME (w)))->charstarts[this_line_vpos + 1];
631 631 int i;
632 if (Z - tlendpos == ZV) 632 int adjust;
633 /* This line ends at end of (accessible part of) buffer. 633
634 There is no newline to count. */ 634 if (Z - tlendpos == ZV)
635 adjust = Z - tlendpos - charstart_next_line[left]; 635 /* This line ends at end of (accessible part of) buffer.
636 else 636 There is no newline to count. */
637 /* This line ends in a newline. 637 adjust = Z - tlendpos - charstart_next_line[left];
638 Must take account of the newline and the rest of the 638 else
639 text that follows. */ 639 /* This line ends in a newline.
640 adjust = Z - tlendpos + 1 - charstart_next_line[left]; 640 Must take account of the newline and the rest of the
641 641 text that follows. */
642 adjust_window_charstarts (w, this_line_vpos, adjust); 642 adjust = Z - tlendpos + 1 - charstart_next_line[left];
643
644 adjust_window_charstarts (w, this_line_vpos, adjust);
645 }
643 646
644 if (XFASTINT (w->width) != FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) 647 if (XFASTINT (w->width) != FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))))
645 preserve_other_columns (w); 648 preserve_other_columns (w);
@@ -829,6 +832,7 @@ update:
829 w->window_end_valid = Qt; 832 w->window_end_valid = Qt;
830 last_arrow_position = Voverlay_arrow_position; 833 last_arrow_position = Voverlay_arrow_position;
831 last_arrow_string = Voverlay_arrow_string; 834 last_arrow_string = Voverlay_arrow_string;
835 verify_charstarts (w);
832 if (frame_up_to_date_hook != 0) 836 if (frame_up_to_date_hook != 0)
833 (*frame_up_to_date_hook) (selected_frame); 837 (*frame_up_to_date_hook) (selected_frame);
834 } 838 }
@@ -2071,12 +2075,15 @@ display_text_line (w, start, vpos, hpos, taboffset)
2071#ifdef USE_TEXT_PROPERTIES 2075#ifdef USE_TEXT_PROPERTIES
2072 next_invisible = pos; 2076 next_invisible = pos;
2073#endif 2077#endif
2074 while (p1 < endp) 2078 while (1)
2075 { 2079 {
2076 /* Record which glyph starts a character, 2080 /* Record which glyph starts a character,
2077 and the character position of that character. */ 2081 and the character position of that character. */
2078 charstart[p1 - p1start] = pos; 2082 charstart[p1 - p1start] = pos;
2079 2083
2084 if (p1 >= endp)
2085 break;
2086
2080 p1prev = p1; 2087 p1prev = p1;
2081 if (pos >= pause) 2088 if (pos >= pause)
2082 { 2089 {
@@ -2287,7 +2294,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
2287 /* Store 0 in this charstart line for the positions where 2294 /* Store 0 in this charstart line for the positions where
2288 there is no character. But do leave what was recorded 2295 there is no character. But do leave what was recorded
2289 for the character that ended the line. */ 2296 for the character that ended the line. */
2290 for (i = p1 - p1start + 1; i < endp - p1start; i++) 2297 /* Add 1 in the endtest to compensate for the fact that ENDP was
2298 made from WIDTH, which is 1 less than the window's actual
2299 internal width. */
2300 for (i = p1 - p1start + 1; i < endp - p1start + 1; i++)
2291 charstart[i] = 0; 2301 charstart[i] = 0;
2292 2302
2293 /* Handle continuation in middle of a character */ 2303 /* Handle continuation in middle of a character */