diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 54 |
2 files changed, 32 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index eaaa46952eb..1e9f0977f61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2001-08-07 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (start_display): Don't try to determine the continuation | ||
| 4 | lines width if lines are truncated. It's superfluous and leads to | ||
| 5 | incorrect results if POS is not visible in the window after | ||
| 6 | reseating the iterator at the previous line start. | ||
| 7 | |||
| 1 | 2001-08-06 Gerd Moellmann <gerd@gnu.org> | 8 | 2001-08-06 Gerd Moellmann <gerd@gnu.org> |
| 2 | 9 | ||
| 3 | * xterm.c (x_dump_glyph_string): Put in #if GLYPH_DEBUG. | 10 | * xterm.c (x_dump_glyph_string): Put in #if GLYPH_DEBUG. |
diff --git a/src/xdisp.c b/src/xdisp.c index 88d85803617..b5a28cb826a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1705,36 +1705,32 @@ start_display (it, w, pos) | |||
| 1705 | struct window *w; | 1705 | struct window *w; |
| 1706 | struct text_pos pos; | 1706 | struct text_pos pos; |
| 1707 | { | 1707 | { |
| 1708 | int start_at_line_beg_p; | ||
| 1709 | struct glyph_row *row; | 1708 | struct glyph_row *row; |
| 1710 | int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; | 1709 | int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; |
| 1711 | int first_y; | ||
| 1712 | 1710 | ||
| 1713 | row = w->desired_matrix->rows + first_vpos; | 1711 | row = w->desired_matrix->rows + first_vpos; |
| 1714 | init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID); | 1712 | init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID); |
| 1715 | first_y = it->current_y; | 1713 | |
| 1716 | 1714 | if (!it->truncate_lines_p) | |
| 1717 | /* If window start is not at a line start, move back to the line | 1715 | { |
| 1718 | start. This makes sure that we take continuation lines into | 1716 | int start_at_line_beg_p; |
| 1719 | account. */ | 1717 | int first_y = it->current_y; |
| 1720 | start_at_line_beg_p = (CHARPOS (pos) == BEGV | 1718 | |
| 1721 | || FETCH_BYTE (BYTEPOS (pos) - 1) == '\n'); | 1719 | /* If window start is not at a line start, skip forward to POS to |
| 1722 | if (!start_at_line_beg_p) | 1720 | get the correct continuation lines width. */ |
| 1723 | reseat_at_previous_visible_line_start (it); | 1721 | start_at_line_beg_p = (CHARPOS (pos) == BEGV |
| 1724 | 1722 | || FETCH_BYTE (BYTEPOS (pos) - 1) == '\n'); | |
| 1725 | /* If window start is not at a line start, skip forward to POS to | 1723 | if (!start_at_line_beg_p) |
| 1726 | get the correct continuation_lines_width and current_x. */ | ||
| 1727 | if (!start_at_line_beg_p) | ||
| 1728 | { | ||
| 1729 | move_it_to (it, CHARPOS (pos), -1, -1, -1, MOVE_TO_POS); | ||
| 1730 | |||
| 1731 | /* If lines are continued, this line may end in the middle of a | ||
| 1732 | multi-glyph character (e.g. a control character displayed as | ||
| 1733 | \003, or in the middle of an overlay string). In this case | ||
| 1734 | move_it_to above will not have taken us to the start of | ||
| 1735 | the continuation line but to the end of the continued line. */ | ||
| 1736 | if (!it->truncate_lines_p) | ||
| 1737 | { | 1724 | { |
| 1725 | reseat_at_previous_visible_line_start (it); | ||
| 1726 | move_it_to (it, CHARPOS (pos), -1, -1, -1, MOVE_TO_POS); | ||
| 1727 | |||
| 1728 | /* If lines are continued, this line may end in the middle | ||
| 1729 | of a multi-glyph character (e.g. a control character | ||
| 1730 | displayed as \003, or in the middle of an overlay | ||
| 1731 | string). In this case move_it_to above will not have | ||
| 1732 | taken us to the start of the continuation line but to the | ||
| 1733 | end of the continued line. */ | ||
| 1738 | if (it->current_x > 0) | 1734 | if (it->current_x > 0) |
| 1739 | { | 1735 | { |
| 1740 | if (it->current.dpvec_index >= 0 | 1736 | if (it->current.dpvec_index >= 0 |
| @@ -1743,7 +1739,7 @@ start_display (it, w, pos) | |||
| 1743 | set_iterator_to_next (it, 1); | 1739 | set_iterator_to_next (it, 1); |
| 1744 | move_it_in_display_line_to (it, -1, -1, 0); | 1740 | move_it_in_display_line_to (it, -1, -1, 0); |
| 1745 | } | 1741 | } |
| 1746 | 1742 | ||
| 1747 | it->continuation_lines_width += it->current_x; | 1743 | it->continuation_lines_width += it->current_x; |
| 1748 | } | 1744 | } |
| 1749 | 1745 | ||
| @@ -1752,11 +1748,11 @@ start_display (it, w, pos) | |||
| 1752 | fields in the iterator structure. */ | 1748 | fields in the iterator structure. */ |
| 1753 | it->max_ascent = it->max_descent = 0; | 1749 | it->max_ascent = it->max_descent = 0; |
| 1754 | it->max_phys_ascent = it->max_phys_descent = 0; | 1750 | it->max_phys_ascent = it->max_phys_descent = 0; |
| 1755 | } | ||
| 1756 | 1751 | ||
| 1757 | it->current_y = first_y; | 1752 | it->current_y = first_y; |
| 1758 | it->vpos = 0; | 1753 | it->vpos = 0; |
| 1759 | it->current_x = it->hpos = 0; | 1754 | it->current_x = it->hpos = 0; |
| 1755 | } | ||
| 1760 | } | 1756 | } |
| 1761 | 1757 | ||
| 1762 | #if 0 /* Don't assert the following because start_display is sometimes | 1758 | #if 0 /* Don't assert the following because start_display is sometimes |