diff options
| author | Eli Zaretskii | 2010-04-24 14:07:27 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-24 14:07:27 +0300 |
| commit | a49884a673bcdd1c7d7fb4c4bfd9393440436ff4 (patch) | |
| tree | dfffc63248620f7e71a50119ffed761449bb3cc5 /src | |
| parent | 76db6fccee00ddc2584cbe6f0cdcd0bb11e884f6 (diff) | |
| download | emacs-a49884a673bcdd1c7d7fb4c4bfd9393440436ff4.tar.gz emacs-a49884a673bcdd1c7d7fb4c4bfd9393440436ff4.zip | |
Fix cursor motion at end of line that ends with a composite 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 | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 19 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 66fc3c1546b..7561d6ebf61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2010-04-24 Eli Zaretskii <eliz@gnu.org> | 1 | 2010-04-24 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 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 | |||
| 3 | * .gdbinit: Add a "set Fmake_symbol" line to force GDB to load the | 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 | ||
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 | } |