diff options
| author | Kim F. Storm | 2004-03-19 20:32:39 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-03-19 20:32:39 +0000 |
| commit | 4540d74ccddb176e48267e58c63eb7a3fff72f12 (patch) | |
| tree | 461295dca1759227250007814eb83ed427a789cf /src | |
| parent | 992126decd80d366685c7c8adda3bf3f14a8d226 (diff) | |
| download | emacs-4540d74ccddb176e48267e58c63eb7a3fff72f12.tar.gz emacs-4540d74ccddb176e48267e58c63eb7a3fff72f12.zip | |
(move_it_in_display_line_to): Fix MOVE_TO_POS case when
to_charpos corresponds to newline in right fringe. Use local
BUFFER_POS_REACHED_P macro.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index cf8ca02bc10..d39c72f2588 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5594,15 +5594,18 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5594 | saved_glyph_row = it->glyph_row; | 5594 | saved_glyph_row = it->glyph_row; |
| 5595 | it->glyph_row = NULL; | 5595 | it->glyph_row = NULL; |
| 5596 | 5596 | ||
| 5597 | #define BUFFER_POS_REACHED_P() \ | ||
| 5598 | ((op & MOVE_TO_POS) != 0 \ | ||
| 5599 | && BUFFERP (it->object) \ | ||
| 5600 | && IT_CHARPOS (*it) >= to_charpos) | ||
| 5601 | |||
| 5597 | while (1) | 5602 | while (1) |
| 5598 | { | 5603 | { |
| 5599 | int x, i, ascent = 0, descent = 0; | 5604 | int x, i, ascent = 0, descent = 0; |
| 5600 | 5605 | ||
| 5601 | /* Stop when ZV or TO_CHARPOS reached. */ | 5606 | /* Stop when ZV or TO_CHARPOS reached. */ |
| 5602 | if (!get_next_display_element (it) | 5607 | if (!get_next_display_element (it) |
| 5603 | || ((op & MOVE_TO_POS) != 0 | 5608 | || BUFFER_POS_REACHED_P ()) |
| 5604 | && BUFFERP (it->object) | ||
| 5605 | && IT_CHARPOS (*it) >= to_charpos)) | ||
| 5606 | { | 5609 | { |
| 5607 | result = MOVE_POS_MATCH_OR_ZV; | 5610 | result = MOVE_POS_MATCH_OR_ZV; |
| 5608 | break; | 5611 | break; |
| @@ -5689,7 +5692,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5689 | #ifdef HAVE_WINDOW_SYSTEM | 5692 | #ifdef HAVE_WINDOW_SYSTEM |
| 5690 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) | 5693 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) |
| 5691 | { | 5694 | { |
| 5692 | if (!get_next_display_element (it)) | 5695 | if (!get_next_display_element (it) |
| 5696 | || BUFFER_POS_REACHED_P ()) | ||
| 5693 | { | 5697 | { |
| 5694 | result = MOVE_POS_MATCH_OR_ZV; | 5698 | result = MOVE_POS_MATCH_OR_ZV; |
| 5695 | break; | 5699 | break; |
| @@ -5761,7 +5765,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5761 | #ifdef HAVE_WINDOW_SYSTEM | 5765 | #ifdef HAVE_WINDOW_SYSTEM |
| 5762 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) | 5766 | if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) |
| 5763 | { | 5767 | { |
| 5764 | if (!get_next_display_element (it)) | 5768 | if (!get_next_display_element (it) |
| 5769 | || BUFFER_POS_REACHED_P ()) | ||
| 5765 | { | 5770 | { |
| 5766 | result = MOVE_POS_MATCH_OR_ZV; | 5771 | result = MOVE_POS_MATCH_OR_ZV; |
| 5767 | break; | 5772 | break; |
| @@ -5778,6 +5783,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) | |||
| 5778 | } | 5783 | } |
| 5779 | } | 5784 | } |
| 5780 | 5785 | ||
| 5786 | #undef BUFFER_POS_REACHED_P | ||
| 5787 | |||
| 5781 | /* Restore the iterator settings altered at the beginning of this | 5788 | /* Restore the iterator settings altered at the beginning of this |
| 5782 | function. */ | 5789 | function. */ |
| 5783 | it->glyph_row = saved_glyph_row; | 5790 | it->glyph_row = saved_glyph_row; |