diff options
| author | Eli Zaretskii | 2010-02-20 11:22:07 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-02-20 11:22:07 -0500 |
| commit | 918f41599dfab54071920441d86c306ced83b550 (patch) | |
| tree | ce3b6ab112c62aac2e0cae3693937e81996c9442 /src | |
| parent | d77fbdad04a1e3f8e4fa1038508379a5f5b8e67e (diff) | |
| download | emacs-918f41599dfab54071920441d86c306ced83b550.tar.gz emacs-918f41599dfab54071920441d86c306ced83b550.zip | |
Continue work on continuation lines.
xdisp.c (set_cursor_from_row): Compare candidate cursor
positions only in rows whose buffer positions occlude point.
(display_line): Fix computation of row->start and row->end for
empty lines.
dispnew.c (row_equal_p): Compare the reversed_p attributes as well.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.bidi | 10 | ||||
| -rw-r--r-- | src/dispnew.c | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 52 |
3 files changed, 48 insertions, 15 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index 22a19c66300..234723bf6f7 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2010-02-20 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Compare candidate cursor | ||
| 4 | positions only in rows whose buffer positions occlude point. | ||
| 5 | (display_line): Fix computation of row->start and row->end for | ||
| 6 | empty lines. | ||
| 7 | |||
| 8 | * dispnew.c (row_equal_p): Compare the reversed_p attributes as | ||
| 9 | well. | ||
| 10 | |||
| 1 | 2010-02-13 Eli Zaretskii <eliz@gnu.org> | 11 | 2010-02-13 Eli Zaretskii <eliz@gnu.org> |
| 2 | 12 | ||
| 3 | * xdisp.c (set_cursor_from_row): Don't overwrite cursor position | 13 | * xdisp.c (set_cursor_from_row): Don't overwrite cursor position |
diff --git a/src/dispnew.c b/src/dispnew.c index 897d38e48f0..fd470491f78 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -1543,6 +1543,7 @@ row_equal_p (w, a, b, mouse_face_p) | |||
| 1543 | || a->overlapped_p != b->overlapped_p | 1543 | || a->overlapped_p != b->overlapped_p |
| 1544 | || (MATRIX_ROW_CONTINUATION_LINE_P (a) | 1544 | || (MATRIX_ROW_CONTINUATION_LINE_P (a) |
| 1545 | != MATRIX_ROW_CONTINUATION_LINE_P (b)) | 1545 | != MATRIX_ROW_CONTINUATION_LINE_P (b)) |
| 1546 | || a->reversed_p != b->reversed_p | ||
| 1546 | /* Different partially visible characters on left margin. */ | 1547 | /* Different partially visible characters on left margin. */ |
| 1547 | || a->x != b->x | 1548 | || a->x != b->x |
| 1548 | /* Different height. */ | 1549 | /* Different height. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index e8a77af8935..f27d99fa5f9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13012,7 +13012,13 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) | |||
| 13012 | rows whose start and end charpos occlude point. Only set | 13012 | rows whose start and end charpos occlude point. Only set |
| 13013 | w->cursor if we found a better approximation to the cursor | 13013 | w->cursor if we found a better approximation to the cursor |
| 13014 | position than we have from previously examined rows. */ | 13014 | position than we have from previously examined rows. */ |
| 13015 | if (w->cursor.vpos >= 0) | 13015 | if (w->cursor.vpos >= 0 |
| 13016 | /* Make sure cursor.vpos specifies a row whose start and end | ||
| 13017 | charpos occlude point. This is because some callers of this | ||
| 13018 | function leave cursor.vpos at the row where the cursor was | ||
| 13019 | displayed during the last redisplay cycle. */ | ||
| 13020 | && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old | ||
| 13021 | && pt_old < MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))) | ||
| 13016 | { | 13022 | { |
| 13017 | struct glyph *g1 = | 13023 | struct glyph *g1 = |
| 13018 | MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; | 13024 | MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos; |
| @@ -17597,7 +17603,7 @@ display_line (it) | |||
| 17597 | row->end = row_end = it->current; | 17603 | row->end = row_end = it->current; |
| 17598 | else | 17604 | else |
| 17599 | { | 17605 | { |
| 17600 | EMACS_INT min_pos = ZV, max_pos = BEGV; | 17606 | EMACS_INT min_pos = row->start.pos.charpos, max_pos = 0; |
| 17601 | struct glyph *g; | 17607 | struct glyph *g; |
| 17602 | struct it save_it; | 17608 | struct it save_it; |
| 17603 | struct text_pos tpos; | 17609 | struct text_pos tpos; |
| @@ -17612,24 +17618,40 @@ display_line (it) | |||
| 17612 | { | 17618 | { |
| 17613 | if (BUFFERP (g->object)) | 17619 | if (BUFFERP (g->object)) |
| 17614 | { | 17620 | { |
| 17615 | if (g->charpos < min_pos) | 17621 | if (g->charpos && g->charpos < min_pos) |
| 17616 | min_pos = g->charpos; | 17622 | min_pos = g->charpos; |
| 17617 | if (g->charpos > max_pos) | 17623 | if (g->charpos > max_pos) |
| 17618 | max_pos = g->charpos; | 17624 | max_pos = g->charpos; |
| 17619 | } | 17625 | } |
| 17620 | } | 17626 | } |
| 17621 | row->start.pos.charpos = min_pos; | 17627 | if (min_pos < row->start.pos.charpos) |
| 17622 | row->start.pos.bytepos = CHAR_TO_BYTE (min_pos); | 17628 | { |
| 17623 | /* For ROW->end, we need the display element that is _after_ | 17629 | row->start.pos.charpos = min_pos; |
| 17624 | max_pos, in the logical order. Note that this may be after | 17630 | row->start.pos.bytepos = CHAR_TO_BYTE (min_pos); |
| 17625 | skipping some invisible text. */ | 17631 | } |
| 17626 | save_it = *it; | 17632 | if (max_pos == 0) |
| 17627 | it->bidi_p = 0; | 17633 | max_pos = min_pos; |
| 17628 | SET_TEXT_POS (tpos, max_pos, CHAR_TO_BYTE (max_pos)); | 17634 | /* For ROW->end, we need the position that is _after_ max_pos, |
| 17629 | reseat_1 (it, tpos, 0); | 17635 | in the logical order. */ |
| 17630 | set_iterator_to_next (it, 1); | 17636 | SET_TEXT_POS (tpos, max_pos + 1, CHAR_TO_BYTE (max_pos + 1)); |
| 17631 | row->end = row_end = it->current; | 17637 | /* If the character at max_pos+1 is a newline, skip that as |
| 17632 | *it = save_it; | 17638 | well. Note that this may skip some invisible text. */ |
| 17639 | if (FETCH_CHAR (tpos.bytepos) == '\n' | ||
| 17640 | || (FETCH_CHAR (tpos.bytepos) == '\r' && it->selective)) | ||
| 17641 | { | ||
| 17642 | save_it = *it; | ||
| 17643 | it->bidi_p = 0; | ||
| 17644 | reseat_1 (it, tpos, 0); | ||
| 17645 | set_iterator_to_next (it, 1); | ||
| 17646 | row_end = it->current; | ||
| 17647 | *it = save_it; | ||
| 17648 | } | ||
| 17649 | else | ||
| 17650 | { | ||
| 17651 | row_end = it->current; | ||
| 17652 | row_end.pos = tpos; | ||
| 17653 | } | ||
| 17654 | row->end = row_end; | ||
| 17633 | } | 17655 | } |
| 17634 | 17656 | ||
| 17635 | /* Record whether this row ends inside an ellipsis. */ | 17657 | /* Record whether this row ends inside an ellipsis. */ |