aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c78
1 files changed, 59 insertions, 19 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 9568a37ef84..4ac9b9c4c24 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2618,25 +2618,6 @@ display_text_line (w, start, vpos, hpos, taboffset)
2618 p = &FETCH_CHAR (pos); 2618 p = &FETCH_CHAR (pos);
2619 } 2619 }
2620 2620
2621 /* Do nothing here for a char that's entirely off the left edge. */
2622 if (p1 >= leftmargin)
2623 {
2624 /* For all the glyphs occupied by this character, except for the
2625 first, store -1 in charstarts. */
2626 if (p1 != p1prev)
2627 {
2628 int *p2x = &charstart[(p1prev < leftmargin
2629 ? leftmargin : p1prev)
2630 - p1start];
2631 int *p2 = &charstart[(p1 < endp ? p1 : endp) - p1start];
2632
2633 if (p2x < p2)
2634 *p2x++ = prevpos;
2635 while (p2x < p2)
2636 *p2x++ = -1;
2637 }
2638 }
2639
2640 if (p1 >= endp) 2621 if (p1 >= endp)
2641 break; 2622 break;
2642 2623
@@ -2691,6 +2672,25 @@ display_text_line (w, start, vpos, hpos, taboffset)
2691 *p1++ = FAST_MAKE_GLYPH (' ', current_face); 2672 *p1++ = FAST_MAKE_GLYPH (' ', current_face);
2692 } 2673 }
2693#endif 2674#endif
2675
2676 /* Update charstarts for the newline that ended this line. */
2677 /* Do nothing here for a char that's entirely off the left edge
2678 or if it starts at the right edge. */
2679 if (p1 >= leftmargin && p1prev != endp)
2680 {
2681 /* Store the newline's position into charstarts
2682 for the column where the newline starts.
2683 Store -1 for the rest of the glyphs it occupies. */
2684 int *p2x = &charstart[(p1prev < leftmargin
2685 ? leftmargin : p1prev)
2686 - p1start];
2687 int *p2 = &charstart[(p1 < endp ? p1 : endp) - p1start];
2688
2689 *p2x++ = pos;
2690 while (p2x < p2)
2691 *p2x++ = -1;
2692 }
2693
2694 break; 2694 break;
2695 } 2695 }
2696 else if (c == '\t') 2696 else if (c == '\t')
@@ -2728,6 +2728,24 @@ display_text_line (w, start, vpos, hpos, taboffset)
2728 *p1++ = FAST_MAKE_GLYPH (' ', current_face); 2728 *p1++ = FAST_MAKE_GLYPH (' ', current_face);
2729 } 2729 }
2730#endif 2730#endif
2731
2732 /* Update charstarts for the ^M that ended this line. */
2733 /* Do nothing here for a char that's entirely off the left edge
2734 or if it starts at the right edge. */
2735 if (p1 >= leftmargin && p1prev != endp)
2736 {
2737 /* Store the newline's position into charstarts
2738 for the column where the newline starts.
2739 Store -1 for the rest of the glyphs it occupies. */
2740 int *p2x = &charstart[(p1prev < leftmargin
2741 ? leftmargin : p1prev)
2742 - p1start];
2743 int *p2 = &charstart[(p1 < endp ? p1 : endp) - p1start];
2744
2745 *p2x++ = pos;
2746 while (p2x < p2)
2747 *p2x++ = -1;
2748 }
2731 break; 2749 break;
2732 } 2750 }
2733 else if (c < 0200 && ctl_arrow) 2751 else if (c < 0200 && ctl_arrow)
@@ -2761,6 +2779,28 @@ display_text_line (w, start, vpos, hpos, taboffset)
2761 2779
2762 prevpos = pos; 2780 prevpos = pos;
2763 pos++; 2781 pos++;
2782
2783 /* Update charstarts for the character just output. */
2784
2785 /* Do nothing here for a char that's entirely off the left edge. */
2786 if (p1 >= leftmargin)
2787 {
2788 /* Store the char's position into charstarts
2789 for the first glyph occupied by this char.
2790 Store -1 for the rest of the glyphs it occupies. */
2791 if (p1 != p1prev)
2792 {
2793 int *p2x = &charstart[(p1prev < leftmargin
2794 ? leftmargin : p1prev)
2795 - p1start];
2796 int *p2 = &charstart[(p1 < endp ? p1 : endp) - p1start];
2797
2798 if (p2x < p2)
2799 *p2x++ = prevpos;
2800 while (p2x < p2)
2801 *p2x++ = -1;
2802 }
2803 }
2764 } 2804 }
2765 2805
2766 val.hpos = - XINT (w->hscroll); 2806 val.hpos = - XINT (w->hscroll);