diff options
| author | Gerd Moellmann | 2001-03-27 09:59:39 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-27 09:59:39 +0000 |
| commit | 4bde0ebb8d4d97617b74ac9963adb6df8d6e3505 (patch) | |
| tree | a22b44c8f42243b22e09b4fe50f8dc0d2e61260c /src | |
| parent | 0d3141652357e594528f525d364dedd8dae17094 (diff) | |
| download | emacs-4bde0ebb8d4d97617b74ac9963adb6df8d6e3505.tar.gz emacs-4bde0ebb8d4d97617b74ac9963adb6df8d6e3505.zip | |
(in_ellipses_for_invisible_text_p): New function.
(init_from_display_pos): Use it.
(try_window_reusing_current_matrix): Don't use cursor_row_p.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 54 |
2 files changed, 46 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 79d5867183a..8f71a81c79a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2001-03-27 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (in_ellipses_for_invisible_text_p): New function. | ||
| 4 | (init_from_display_pos): Use it. | ||
| 5 | (try_window_reusing_current_matrix): Don't use cursor_row_p. | ||
| 6 | |||
| 1 | 2001-03-26 Gerd Moellmann <gerd@gnu.org> | 7 | 2001-03-26 Gerd Moellmann <gerd@gnu.org> |
| 2 | 8 | ||
| 3 | * xdisp.c (try_window_id): Undo last change. | 9 | * xdisp.c (try_window_id): Undo last change. |
diff --git a/src/xdisp.c b/src/xdisp.c index 704b60c03da..5dc97d0775f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -769,6 +769,8 @@ static int handle_single_display_prop P_ ((struct it *, Lisp_Object, | |||
| 769 | Lisp_Object, struct text_pos *, | 769 | Lisp_Object, struct text_pos *, |
| 770 | int)); | 770 | int)); |
| 771 | static int underlying_face_id P_ ((struct it *)); | 771 | static int underlying_face_id P_ ((struct it *)); |
| 772 | static int in_ellipses_for_invisible_text_p P_ ((struct display_pos *, | ||
| 773 | struct window *)); | ||
| 772 | 774 | ||
| 773 | #define face_before_it_pos(IT) face_before_or_after_it_pos ((IT), 1) | 775 | #define face_before_it_pos(IT) face_before_or_after_it_pos ((IT), 1) |
| 774 | #define face_after_it_pos(IT) face_before_or_after_it_pos ((IT), 0) | 776 | #define face_after_it_pos(IT) face_before_or_after_it_pos ((IT), 0) |
| @@ -1740,18 +1742,17 @@ start_display (it, w, pos) | |||
| 1740 | } | 1742 | } |
| 1741 | 1743 | ||
| 1742 | 1744 | ||
| 1743 | /* Initialize IT for stepping through current_buffer in window W, | 1745 | /* Return 1 if POS is a position in ellipses displayed for invisible |
| 1744 | starting at position POS that includes overlay string and display | 1746 | text. W is the window we display, for text property lookup. */ |
| 1745 | vector/ control character translation position information. */ | ||
| 1746 | 1747 | ||
| 1747 | static void | 1748 | static int |
| 1748 | init_from_display_pos (it, w, pos) | 1749 | in_ellipses_for_invisible_text_p (pos, w) |
| 1749 | struct it *it; | ||
| 1750 | struct window *w; | ||
| 1751 | struct display_pos *pos; | 1750 | struct display_pos *pos; |
| 1751 | struct window *w; | ||
| 1752 | { | 1752 | { |
| 1753 | int charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos); | ||
| 1754 | Lisp_Object prop, window; | 1753 | Lisp_Object prop, window; |
| 1754 | int ellipses_p = 0; | ||
| 1755 | int charpos = CHARPOS (pos->pos); | ||
| 1755 | 1756 | ||
| 1756 | /* If POS specifies a position in a display vector, this might | 1757 | /* If POS specifies a position in a display vector, this might |
| 1757 | be for an ellipsis displayed for invisible text. We won't | 1758 | be for an ellipsis displayed for invisible text. We won't |
| @@ -1770,10 +1771,33 @@ init_from_display_pos (it, w, pos) | |||
| 1770 | window); | 1771 | window); |
| 1771 | if (TEXT_PROP_MEANS_INVISIBLE (prop) | 1772 | if (TEXT_PROP_MEANS_INVISIBLE (prop) |
| 1772 | && TEXT_PROP_MEANS_INVISIBLE_WITH_ELLIPSIS (prop)) | 1773 | && TEXT_PROP_MEANS_INVISIBLE_WITH_ELLIPSIS (prop)) |
| 1773 | { | 1774 | ellipses_p = 1; |
| 1774 | --charpos; | 1775 | } |
| 1775 | bytepos = 0; | 1776 | |
| 1776 | } | 1777 | return ellipses_p; |
| 1778 | } | ||
| 1779 | |||
| 1780 | |||
| 1781 | /* Initialize IT for stepping through current_buffer in window W, | ||
| 1782 | starting at position POS that includes overlay string and display | ||
| 1783 | vector/ control character translation position information. */ | ||
| 1784 | |||
| 1785 | static void | ||
| 1786 | init_from_display_pos (it, w, pos) | ||
| 1787 | struct it *it; | ||
| 1788 | struct window *w; | ||
| 1789 | struct display_pos *pos; | ||
| 1790 | { | ||
| 1791 | int charpos = CHARPOS (pos->pos), bytepos = BYTEPOS (pos->pos); | ||
| 1792 | |||
| 1793 | /* If POS specifies a position in a display vector, this might | ||
| 1794 | be for an ellipsis displayed for invisible text. We won't | ||
| 1795 | get the iterator set up for delivering that ellipsis unless | ||
| 1796 | we make sure that it gets aware of the invisible text. */ | ||
| 1797 | if (in_ellipses_for_invisible_text_p (pos, w)) | ||
| 1798 | { | ||
| 1799 | --charpos; | ||
| 1800 | bytepos = 0; | ||
| 1777 | } | 1801 | } |
| 1778 | 1802 | ||
| 1779 | /* Keep in mind: the call to reseat in init_iterator skips invisible | 1803 | /* Keep in mind: the call to reseat in init_iterator skips invisible |
| @@ -10460,7 +10484,8 @@ try_window_reusing_current_matrix (w) | |||
| 10460 | row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); | 10484 | row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
| 10461 | while (MATRIX_ROW_DISPLAYS_TEXT_P (row)) | 10485 | while (MATRIX_ROW_DISPLAYS_TEXT_P (row)) |
| 10462 | { | 10486 | { |
| 10463 | if (cursor_row_p (w, row)) | 10487 | if (PT >= MATRIX_ROW_START_CHARPOS (row) |
| 10488 | && PT < MATRIX_ROW_END_CHARPOS (row)) | ||
| 10464 | { | 10489 | { |
| 10465 | set_cursor_from_row (w, row, w->current_matrix, 0, 0, | 10490 | set_cursor_from_row (w, row, w->current_matrix, 0, 0, |
| 10466 | dy, nrows_scrolled); | 10491 | dy, nrows_scrolled); |
| @@ -10617,7 +10642,8 @@ try_window_reusing_current_matrix (w) | |||
| 10617 | MATRIX_ROW_BOTTOM_Y (first_row_to_display) < yb; | 10642 | MATRIX_ROW_BOTTOM_Y (first_row_to_display) < yb; |
| 10618 | ++first_row_to_display) | 10643 | ++first_row_to_display) |
| 10619 | { | 10644 | { |
| 10620 | if (cursor_row_p (w, first_row_to_display)) | 10645 | if (PT >= MATRIX_ROW_START_CHARPOS (first_row_to_display) |
| 10646 | && PT < MATRIX_ROW_END_CHARPOS (first_row_to_display)) | ||
| 10621 | pt_row = first_row_to_display; | 10647 | pt_row = first_row_to_display; |
| 10622 | } | 10648 | } |
| 10623 | 10649 | ||