From 0e47bbf745299990bdc1dcbaafe29ca8bb45b551 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 29 Nov 2002 16:20:20 +0000 Subject: [PATCH] (start_display): Check more intelligently for whether the line is continued. (move_it_vertically_backward): Clear it->continuation_lines_width. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b12eca0377..4cc611c585 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2002-11-29 Richard M. Stallman + + * xdisp.c (start_display): Check more intelligently for + whether the line is continued. + (move_it_vertically_backward): Clear it->continuation_lines_width. + 2002-11-28 Dave Love * s/amdahl.h, s/unipl5-0.h, m/sgi3000.h, s/3700.h, s/alliant-2800.h: diff --git a/src/xdisp.c b/src/xdisp.c index 36d26f5cef..38df34d7c5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1791,16 +1791,27 @@ start_display (it, w, pos) || FETCH_BYTE (BYTEPOS (pos) - 1) == '\n'); if (!start_at_line_beg_p) { + int new_x; + reseat_at_previous_visible_line_start (it); move_it_to (it, CHARPOS (pos), -1, -1, -1, MOVE_TO_POS); + new_x = it->current_x + it->pixel_width; + /* If lines are continued, this line may end in the middle of a multi-glyph character (e.g. a control character displayed as \003, or in the middle of an overlay string). In this case move_it_to above will not have taken us to the start of the continuation line but to the end of the continued line. */ - if (it->current_x > 0) + if (it->current_x > 0 + && !it->truncate_lines_p /* Lines are continued. */ + && (/* And glyph doesn't fit on the line. */ + new_x > it->last_visible_x + /* Or it fits exactly and we're on a window + system frame. */ + || (new_x == it->last_visible_x + && FRAME_WINDOW_P (it->f)))) { if (it->current.dpvec_index >= 0 || it->current.overlay_string_index >= 0) @@ -5407,6 +5418,7 @@ move_it_vertically_backward (it, dy) /* We are now surely at a line start. */ it->current_x = it->hpos = 0; + it->continuation_lines_width = 0; /* Move forward and see what y-distance we moved. First move to the start of the next line so that we get its height. We need this -- 2.39.2