diff options
| author | Eli Zaretskii | 2010-04-24 14:11:40 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-24 14:11:40 +0300 |
| commit | 51d28d3ec44e006746d1107f1819824d803c6232 (patch) | |
| tree | eeb8dbfa893f3544c3db3fb8568ff8e93972a7e5 /src | |
| parent | 2d4018aa48efa359bcc5cce63d9335204ce53ff9 (diff) | |
| parent | a49884a673bcdd1c7d7fb4c4bfd9393440436ff4 (diff) | |
| download | emacs-51d28d3ec44e006746d1107f1819824d803c6232.tar.gz emacs-51d28d3ec44e006746d1107f1819824d803c6232.zip | |
Fix cursor motion at end of line that ends in a composed character.
xdisp.c (display_line): Use `reseat' instead of `reseat_1', and
use `get_next_display_element' and `set_iterator_to_next' to
advance to the next character, when looking for the character that
begins the next row.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/xdisp.c | 19 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 033a32a0a58..7979e809a9d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,11 @@ | |||
| 1 | 2010-04-24 Eli Zaretskii <eliz@gnu.org> | 1 | 2010-04-24 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * .gdbinit: Add a "set Fmake_symbol" line to force GDB load the | 3 | * xdisp.c (display_line): Use `reseat' instead of `reseat_1', and |
| 4 | use `get_next_display_element' and `set_iterator_to_next' to | ||
| 5 | advance to the next character, when looking for the character that | ||
| 6 | begins the next row. | ||
| 7 | |||
| 8 | * .gdbinit: Add a "set Fmake_symbol" line to force GDB to load the | ||
| 4 | definition of "struct Lisp_Symbol". | 9 | definition of "struct Lisp_Symbol". |
| 5 | 10 | ||
| 6 | 2010-04-24 Glenn Morris <rgm@gnu.org> | 11 | 2010-04-24 Glenn Morris <rgm@gnu.org> |
| @@ -55,6 +60,10 @@ | |||
| 55 | 60 | ||
| 56 | Support `display' text properties and overlay strings in bidi | 61 | Support `display' text properties and overlay strings in bidi |
| 57 | buffers. | 62 | buffers. |
| 63 | ======= | ||
| 64 | 2010-04-23 Eli Zaretskii <eliz@gnu.org> | ||
| 65 | |||
| 66 | >>>>>>> MERGE-SOURCE | ||
| 58 | * xdisp.c (pop_it): When the stack is popped after displaying | 67 | * xdisp.c (pop_it): When the stack is popped after displaying |
| 59 | from a string, bidi-iterate to exit from the text portion covered | 68 | from a string, bidi-iterate to exit from the text portion covered |
| 60 | by the `display' property or overlay. (Bug#5988, bug#5920) | 69 | by the `display' property or overlay. (Bug#5988, bug#5920) |
diff --git a/src/xdisp.c b/src/xdisp.c index 753ea16db01..5e5684a845d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -17969,17 +17969,20 @@ display_line (it) | |||
| 17969 | } | 17969 | } |
| 17970 | else if (row->used[TEXT_AREA] && max_pos) | 17970 | else if (row->used[TEXT_AREA] && max_pos) |
| 17971 | { | 17971 | { |
| 17972 | SET_TEXT_POS (tpos, max_pos + 1, CHAR_TO_BYTE (max_pos + 1)); | 17972 | SET_TEXT_POS (tpos, max_pos, CHAR_TO_BYTE (max_pos)); |
| 17973 | save_it = *it; | ||
| 17974 | it->bidi_p = 0; | ||
| 17975 | reseat (it, tpos, 0); | ||
| 17976 | if (!get_next_display_element (it)) | ||
| 17977 | abort (); /* row at ZV was already handled above */ | ||
| 17978 | set_iterator_to_next (it, 1); | ||
| 17973 | row_end = it->current; | 17979 | row_end = it->current; |
| 17974 | row_end.pos = tpos; | ||
| 17975 | /* If the character at max_pos+1 is a newline, skip that as | 17980 | /* If the character at max_pos+1 is a newline, skip that as |
| 17976 | well. Note that this may skip some invisible text. */ | 17981 | well. Note that this may skip some invisible text. */ |
| 17977 | if (FETCH_CHAR (tpos.bytepos) == '\n' | 17982 | if (!get_next_display_element (it)) |
| 17978 | || (FETCH_CHAR (tpos.bytepos) == '\r' && it->selective)) | 17983 | abort (); |
| 17984 | if (ITERATOR_AT_END_OF_LINE_P (it)) | ||
| 17979 | { | 17985 | { |
| 17980 | save_it = *it; | ||
| 17981 | it->bidi_p = 0; | ||
| 17982 | reseat_1 (it, tpos, 0); | ||
| 17983 | set_iterator_to_next (it, 1); | 17986 | set_iterator_to_next (it, 1); |
| 17984 | /* Record the position after the newline of a continued | 17987 | /* Record the position after the newline of a continued |
| 17985 | row. We will need that to set ROW->end of the last | 17988 | row. We will need that to set ROW->end of the last |
| @@ -17994,7 +17997,6 @@ display_line (it) | |||
| 17994 | row_end = it->current; | 17997 | row_end = it->current; |
| 17995 | save_it.eol_pos.charpos = save_it.eol_pos.bytepos = 0; | 17998 | save_it.eol_pos.charpos = save_it.eol_pos.bytepos = 0; |
| 17996 | } | 17999 | } |
| 17997 | *it = save_it; | ||
| 17998 | } | 18000 | } |
| 17999 | else if (!row->continued_p | 18001 | else if (!row->continued_p |
| 18000 | && MATRIX_ROW_CONTINUATION_LINE_P (row) | 18002 | && MATRIX_ROW_CONTINUATION_LINE_P (row) |
| @@ -18008,6 +18010,7 @@ display_line (it) | |||
| 18008 | row_end.pos = it->eol_pos; | 18010 | row_end.pos = it->eol_pos; |
| 18009 | it->eol_pos.charpos = it->eol_pos.bytepos = 0; | 18011 | it->eol_pos.charpos = it->eol_pos.bytepos = 0; |
| 18010 | } | 18012 | } |
| 18013 | *it = save_it; | ||
| 18011 | row->end = row_end; | 18014 | row->end = row_end; |
| 18012 | } | 18015 | } |
| 18013 | } | 18016 | } |