diff options
| author | Gerd Moellmann | 2000-06-06 20:02:39 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-06-06 20:02:39 +0000 |
| commit | 91004049759c848b217a947f5043983bbc25f791 (patch) | |
| tree | 788c7a316f4b63cc11e7dc68c9cb87374a415635 /src | |
| parent | 346181f0cde6b5029f5ab036d97636dc43b9bf03 (diff) | |
| download | emacs-91004049759c848b217a947f5043983bbc25f791.tar.gz emacs-91004049759c848b217a947f5043983bbc25f791.zip | |
(display_line): Set row's and iterator's
starts_in_middle_of_char_p and ends_in_middle_of_char_p flags.
Set cursor even if row ends in the middle of a character.
(dump_glyph_row): Print values of new flags.
(redisplay_window) <cursor movement in unchanged window>: When
point has been moved forward, and PT is at the end of the cursor
row, don't place the cursor in the next row if the cursor row ends
in the middle of a character or at ZV.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 3affc6e132b..d6b8ed694b3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -8835,20 +8835,26 @@ redisplay_window (window, just_this_one_p) | |||
| 8835 | /* Point has moved forward. */ | 8835 | /* Point has moved forward. */ |
| 8836 | int last_y = window_text_bottom_y (w) - this_scroll_margin; | 8836 | int last_y = window_text_bottom_y (w) - this_scroll_margin; |
| 8837 | 8837 | ||
| 8838 | while ((MATRIX_ROW_END_CHARPOS (row) < PT | 8838 | while (MATRIX_ROW_END_CHARPOS (row) < PT |
| 8839 | /* The end position of a row equals the start | ||
| 8840 | position of the next row. If PT is there, we | ||
| 8841 | would rather display it in the next line, except | ||
| 8842 | when this line ends in ZV. */ | ||
| 8843 | || (MATRIX_ROW_END_CHARPOS (row) == PT | ||
| 8844 | && (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row) | ||
| 8845 | || !row->ends_at_zv_p))) | ||
| 8846 | && MATRIX_ROW_BOTTOM_Y (row) < last_y) | 8839 | && MATRIX_ROW_BOTTOM_Y (row) < last_y) |
| 8847 | { | 8840 | { |
| 8848 | xassert (row->enabled_p); | 8841 | xassert (row->enabled_p); |
| 8849 | ++row; | 8842 | ++row; |
| 8850 | } | 8843 | } |
| 8851 | 8844 | ||
| 8845 | /* The end position of a row equals the start position of | ||
| 8846 | the next row. If PT is there, we would rather display it | ||
| 8847 | in the next line. Exceptions are when the row ends in | ||
| 8848 | the middle of a character, or ends in ZV. */ | ||
| 8849 | if (MATRIX_ROW_BOTTOM_Y (row) < last_y | ||
| 8850 | && MATRIX_ROW_END_CHARPOS (row) == PT | ||
| 8851 | && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row) | ||
| 8852 | && !row->ends_at_zv_p) | ||
| 8853 | { | ||
| 8854 | xassert (row->enabled_p); | ||
| 8855 | ++row; | ||
| 8856 | } | ||
| 8857 | |||
| 8852 | /* If within the scroll margin, scroll. Note that | 8858 | /* If within the scroll margin, scroll. Note that |
| 8853 | MATRIX_ROW_BOTTOM_Y gives the pixel position at which the | 8859 | MATRIX_ROW_BOTTOM_Y gives the pixel position at which the |
| 8854 | next line would be drawn, and that this_scroll_margin can | 8860 | next line would be drawn, and that this_scroll_margin can |
| @@ -10586,10 +10592,10 @@ dump_glyph_row (matrix, vpos, with_glyphs_p) | |||
| 10586 | 10592 | ||
| 10587 | row = MATRIX_ROW (matrix, vpos); | 10593 | row = MATRIX_ROW (matrix, vpos); |
| 10588 | 10594 | ||
| 10589 | fprintf (stderr, "Row Start End Used oEI><O\\CTZF X Y W\n"); | 10595 | fprintf (stderr, "Row Start End Used oEI><O\\CTZFes X Y W\n"); |
| 10590 | fprintf (stderr, "=============================================\n"); | 10596 | fprintf (stderr, "=============================================\n"); |
| 10591 | 10597 | ||
| 10592 | fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d\n", | 10598 | fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d\n", |
| 10593 | row - matrix->rows, | 10599 | row - matrix->rows, |
| 10594 | MATRIX_ROW_START_CHARPOS (row), | 10600 | MATRIX_ROW_START_CHARPOS (row), |
| 10595 | MATRIX_ROW_END_CHARPOS (row), | 10601 | MATRIX_ROW_END_CHARPOS (row), |
| @@ -10605,6 +10611,8 @@ dump_glyph_row (matrix, vpos, with_glyphs_p) | |||
| 10605 | row->displays_text_p, | 10611 | row->displays_text_p, |
| 10606 | row->ends_at_zv_p, | 10612 | row->ends_at_zv_p, |
| 10607 | row->fill_line_p, | 10613 | row->fill_line_p, |
| 10614 | row->ends_in_middle_of_char_p, | ||
| 10615 | row->starts_in_middle_of_char_p, | ||
| 10608 | row->x, | 10616 | row->x, |
| 10609 | row->y, | 10617 | row->y, |
| 10610 | row->pixel_width); | 10618 | row->pixel_width); |
| @@ -11203,6 +11211,8 @@ display_line (it) | |||
| 11203 | row->start = it->current; | 11211 | row->start = it->current; |
| 11204 | row->continuation_lines_width = it->continuation_lines_width; | 11212 | row->continuation_lines_width = it->continuation_lines_width; |
| 11205 | row->displays_text_p = 1; | 11213 | row->displays_text_p = 1; |
| 11214 | row->starts_in_middle_of_char_p = it->starts_in_middle_of_char_p; | ||
| 11215 | it->starts_in_middle_of_char_p = 0; | ||
| 11206 | 11216 | ||
| 11207 | /* Arrange the overlays nicely for our purposes. Usually, we call | 11217 | /* Arrange the overlays nicely for our purposes. Usually, we call |
| 11208 | display_line on only one line at a time, in which case this | 11218 | display_line on only one line at a time, in which case this |
| @@ -11387,6 +11397,11 @@ display_line (it) | |||
| 11387 | 11397 | ||
| 11388 | it->current_x = x; | 11398 | it->current_x = x; |
| 11389 | it->continuation_lines_width += x; | 11399 | it->continuation_lines_width += x; |
| 11400 | if (nglyphs > 1 && i > 0) | ||
| 11401 | { | ||
| 11402 | row->ends_in_middle_of_char_p = 1; | ||
| 11403 | it->starts_in_middle_of_char_p = 1; | ||
| 11404 | } | ||
| 11390 | 11405 | ||
| 11391 | /* Restore the height to what it was before the | 11406 | /* Restore the height to what it was before the |
| 11392 | element not fitting on the line. */ | 11407 | element not fitting on the line. */ |
| @@ -11538,15 +11553,15 @@ display_line (it) | |||
| 11538 | /* Remember the position at which this line ends. */ | 11553 | /* Remember the position at which this line ends. */ |
| 11539 | row->end = it->current; | 11554 | row->end = it->current; |
| 11540 | 11555 | ||
| 11541 | /* Maybe set the cursor. If you change this, it's probably a good | 11556 | /* Maybe set the cursor. We want to set the cursor on the first |
| 11542 | idea to also change the code in redisplay_window for cursor | 11557 | glyph having position PT. This means it doesn't matter if the |
| 11543 | movement in an unchanged window. */ | 11558 | row is continued and ends in the middle of the character at PT. |
| 11559 | If some glyphs of that character are in this row, this is the | ||
| 11560 | right row to put the cursor on. */ | ||
| 11544 | if (it->w->cursor.vpos < 0 | 11561 | if (it->w->cursor.vpos < 0 |
| 11545 | && PT >= MATRIX_ROW_START_CHARPOS (row) | 11562 | && PT >= MATRIX_ROW_START_CHARPOS (row) |
| 11546 | && MATRIX_ROW_END_CHARPOS (row) >= PT | 11563 | && PT <= MATRIX_ROW_END_CHARPOS (row) |
| 11547 | && !(MATRIX_ROW_END_CHARPOS (row) == PT | 11564 | && !(PT == ZV && !row->ends_at_zv_p)) |
| 11548 | && (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row) | ||
| 11549 | || !row->ends_at_zv_p))) | ||
| 11550 | set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); | 11565 | set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); |
| 11551 | 11566 | ||
| 11552 | /* Highlight trailing whitespace. */ | 11567 | /* Highlight trailing whitespace. */ |