diff options
| author | Eli Zaretskii | 2011-09-18 18:48:12 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-09-18 18:48:12 +0300 |
| commit | 56cd55c849f9e08e732b9fdda59e12f58867de04 (patch) | |
| tree | e30432ebc10a0574fc3d367da4ba4fdcb4d1307b /src | |
| parent | 3aace4e4b36b946b577cf708cc26fc00d3288a21 (diff) | |
| download | emacs-56cd55c849f9e08e732b9fdda59e12f58867de04.tar.gz emacs-56cd55c849f9e08e732b9fdda59e12f58867de04.zip | |
Fix bug #9530 on a TTY.
src/xdisp.c (display_line): Record maximum and minimum buffer
positions even if no glyphs were produced (e.g., by a zero-width
stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
buffer positions that will be removed from the glyph row because
they don't fit.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e5962fa8fed..09ac0d78e73 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-09-18 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (display_line): Record maximum and minimum buffer | ||
| 4 | positions even if no glyphs were produced (e.g., by a zero-width | ||
| 5 | stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record | ||
| 6 | buffer positions that will be removed from the glyph row because | ||
| 7 | they don't fit. | ||
| 8 | |||
| 1 | 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 9 | 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 10 | ||
| 3 | * xdisp.c (expose_window): Save original value of phys_cursor_on_p | 11 | * xdisp.c (expose_window): Save original value of phys_cursor_on_p |
diff --git a/src/xdisp.c b/src/xdisp.c index 921a332fdc6..b2859d0767b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -18704,11 +18704,6 @@ display_line (struct it *it) | |||
| 18704 | it->current_x = new_x; | 18704 | it->current_x = new_x; |
| 18705 | it->continuation_lines_width += new_x; | 18705 | it->continuation_lines_width += new_x; |
| 18706 | ++it->hpos; | 18706 | ++it->hpos; |
| 18707 | /* Record the maximum and minimum buffer | ||
| 18708 | positions seen so far in glyphs that will be | ||
| 18709 | displayed by this row. */ | ||
| 18710 | if (it->bidi_p) | ||
| 18711 | RECORD_MAX_MIN_POS (it); | ||
| 18712 | if (i == nglyphs - 1) | 18707 | if (i == nglyphs - 1) |
| 18713 | { | 18708 | { |
| 18714 | /* If line-wrap is on, check if a previous | 18709 | /* If line-wrap is on, check if a previous |
| @@ -18723,6 +18718,11 @@ display_line (struct it *it) | |||
| 18723 | || IT_DISPLAYING_WHITESPACE (it))) | 18718 | || IT_DISPLAYING_WHITESPACE (it))) |
| 18724 | goto back_to_wrap; | 18719 | goto back_to_wrap; |
| 18725 | 18720 | ||
| 18721 | /* Record the maximum and minimum buffer | ||
| 18722 | positions seen so far in glyphs that will be | ||
| 18723 | displayed by this row. */ | ||
| 18724 | if (it->bidi_p) | ||
| 18725 | RECORD_MAX_MIN_POS (it); | ||
| 18726 | set_iterator_to_next (it, 1); | 18726 | set_iterator_to_next (it, 1); |
| 18727 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) | 18727 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) |
| 18728 | { | 18728 | { |
| @@ -18740,6 +18740,8 @@ display_line (struct it *it) | |||
| 18740 | } | 18740 | } |
| 18741 | } | 18741 | } |
| 18742 | } | 18742 | } |
| 18743 | else if (it->bidi_p) | ||
| 18744 | RECORD_MAX_MIN_POS (it); | ||
| 18743 | } | 18745 | } |
| 18744 | else if (CHAR_GLYPH_PADDING_P (*glyph) | 18746 | else if (CHAR_GLYPH_PADDING_P (*glyph) |
| 18745 | && !FRAME_WINDOW_P (it->f)) | 18747 | && !FRAME_WINDOW_P (it->f)) |
| @@ -18870,6 +18872,10 @@ display_line (struct it *it) | |||
| 18870 | xassert (it->first_visible_x <= it->last_visible_x); | 18872 | xassert (it->first_visible_x <= it->last_visible_x); |
| 18871 | } | 18873 | } |
| 18872 | } | 18874 | } |
| 18875 | /* Even if this display element produced no glyphs at all, | ||
| 18876 | we want to record its position. */ | ||
| 18877 | if (it->bidi_p && nglyphs == 0) | ||
| 18878 | RECORD_MAX_MIN_POS (it); | ||
| 18873 | 18879 | ||
| 18874 | row->ascent = max (row->ascent, it->max_ascent); | 18880 | row->ascent = max (row->ascent, it->max_ascent); |
| 18875 | row->height = max (row->height, it->max_ascent + it->max_descent); | 18881 | row->height = max (row->height, it->max_ascent + it->max_descent); |