diff options
| author | Eli Zaretskii | 2010-02-06 12:47:35 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-02-06 12:47:35 -0500 |
| commit | e5f95dc5a35a7ff655527b08d73c05cd3f6f1dc7 (patch) | |
| tree | 07ac221ff79c2babb5fe2a9897bb44e44108cfa2 /src | |
| parent | 565cbcc3282217eea840141a424c692f68093f8e (diff) | |
| download | emacs-e5f95dc5a35a7ff655527b08d73c05cd3f6f1dc7.tar.gz emacs-e5f95dc5a35a7ff655527b08d73c05cd3f6f1dc7.zip | |
Start working on cursor movement in continuation lines.
xdisp.c (move_it_in_display_line_to): New variables prev_method
and prev_pos. Compare for strict equality in
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.bidi | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 18 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index bb0823c4edb..73fd6bf8da2 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2010-02-06 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | Start working on cursor movement in continuation lines. | ||
| 4 | * xdisp.c (move_it_in_display_line_to): New variables prev_method | ||
| 5 | and prev_pos. Compare for strict equality in | ||
| 6 | BUFFER_POS_REACHED_P. | ||
| 7 | |||
| 1 | 2010-01-30 Eli Zaretskii <eliz@gnu.org> | 8 | 2010-01-30 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | Fix fallout from changes to managing glyph row reversed_p flag. | 10 | Fix fallout from changes to managing glyph row reversed_p flag. |
diff --git a/src/xdisp.c b/src/xdisp.c index e9fd8d0af4d..8f366134cea 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7009,6 +7009,8 @@ move_it_in_display_line_to (struct it *it, | |||
| 7009 | struct glyph_row *saved_glyph_row; | 7009 | struct glyph_row *saved_glyph_row; |
| 7010 | struct it wrap_it, atpos_it, atx_it; | 7010 | struct it wrap_it, atpos_it, atx_it; |
| 7011 | int may_wrap = 0; | 7011 | int may_wrap = 0; |
| 7012 | enum it_method prev_method = it->method; | ||
| 7013 | EMACS_INT prev_pos = IT_CHARPOS (*it); | ||
| 7012 | 7014 | ||
| 7013 | /* Don't produce glyphs in produce_glyphs. */ | 7015 | /* Don't produce glyphs in produce_glyphs. */ |
| 7014 | saved_glyph_row = it->glyph_row; | 7016 | saved_glyph_row = it->glyph_row; |
| @@ -7026,7 +7028,7 @@ move_it_in_display_line_to (struct it *it, | |||
| 7026 | #define BUFFER_POS_REACHED_P() \ | 7028 | #define BUFFER_POS_REACHED_P() \ |
| 7027 | ((op & MOVE_TO_POS) != 0 \ | 7029 | ((op & MOVE_TO_POS) != 0 \ |
| 7028 | && BUFFERP (it->object) \ | 7030 | && BUFFERP (it->object) \ |
| 7029 | && IT_CHARPOS (*it) >= to_charpos \ | 7031 | && IT_CHARPOS (*it) == to_charpos \ |
| 7030 | && (it->method == GET_FROM_BUFFER \ | 7032 | && (it->method == GET_FROM_BUFFER \ |
| 7031 | || (it->method == GET_FROM_DISPLAY_VECTOR \ | 7033 | || (it->method == GET_FROM_DISPLAY_VECTOR \ |
| 7032 | && it->dpvec + it->current.dpvec_index + 1 >= it->dpend))) | 7034 | && it->dpvec + it->current.dpvec_index + 1 >= it->dpend))) |
| @@ -7050,7 +7052,14 @@ move_it_in_display_line_to (struct it *it, | |||
| 7050 | if ((op & MOVE_TO_POS) != 0 | 7052 | if ((op & MOVE_TO_POS) != 0 |
| 7051 | && BUFFERP (it->object) | 7053 | && BUFFERP (it->object) |
| 7052 | && it->method == GET_FROM_BUFFER | 7054 | && it->method == GET_FROM_BUFFER |
| 7053 | && IT_CHARPOS (*it) > to_charpos) | 7055 | && (prev_method == GET_FROM_IMAGE |
| 7056 | || prev_method == GET_FROM_STRETCH) | ||
| 7057 | /* Passed TO_CHARPOS from left to right. */ | ||
| 7058 | && ((prev_pos < to_charpos | ||
| 7059 | && IT_CHARPOS (*it) > to_charpos) | ||
| 7060 | /* Passed TO_CHARPOS from right to left. */ | ||
| 7061 | || (prev_pos > to_charpos) | ||
| 7062 | && IT_CHARPOS (*it) < to_charpos)) | ||
| 7054 | { | 7063 | { |
| 7055 | if (it->line_wrap != WORD_WRAP || wrap_it.sp < 0) | 7064 | if (it->line_wrap != WORD_WRAP || wrap_it.sp < 0) |
| 7056 | { | 7065 | { |
| @@ -7064,6 +7073,9 @@ move_it_in_display_line_to (struct it *it, | |||
| 7064 | atpos_it = *it; | 7073 | atpos_it = *it; |
| 7065 | } | 7074 | } |
| 7066 | 7075 | ||
| 7076 | prev_method = it->method; | ||
| 7077 | if (it->method == GET_FROM_BUFFER) | ||
| 7078 | prev_pos = IT_CHARPOS (*it); | ||
| 7067 | /* Stop when ZV reached. | 7079 | /* Stop when ZV reached. |
| 7068 | We used to stop here when TO_CHARPOS reached as well, but that is | 7080 | We used to stop here when TO_CHARPOS reached as well, but that is |
| 7069 | too soon if this glyph does not fit on this line. So we handle it | 7081 | too soon if this glyph does not fit on this line. So we handle it |
| @@ -7329,6 +7341,8 @@ move_it_in_display_line_to (struct it *it, | |||
| 7329 | break; | 7341 | break; |
| 7330 | } | 7342 | } |
| 7331 | 7343 | ||
| 7344 | if (it->method == GET_FROM_BUFFER) | ||
| 7345 | prev_pos = IT_CHARPOS (*it); | ||
| 7332 | /* The current display element has been consumed. Advance | 7346 | /* The current display element has been consumed. Advance |
| 7333 | to the next. */ | 7347 | to the next. */ |
| 7334 | set_iterator_to_next (it, 1); | 7348 | set_iterator_to_next (it, 1); |