diff options
| author | Eli Zaretskii | 2011-08-06 14:49:35 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-08-06 14:49:35 +0300 |
| commit | 75b771e489a32ab716b031664baee313a78caf6b (patch) | |
| tree | 8b1c4ba9abeeb85e2eaad79a1590a0031e93b017 /src | |
| parent | d1410150345acdf2d7693fe00b8169312fe40d14 (diff) | |
| download | emacs-75b771e489a32ab716b031664baee313a78caf6b.tar.gz emacs-75b771e489a32ab716b031664baee313a78caf6b.zip | |
Really fix bug #9224 with vertical-motion under word-wrap.
src/xdisp.c (move_it_in_display_line_to): Fix vertical-motion in a buffer
with word-wrap under bidirectional display.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index efe542e37d0..039c225c1f6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | * xdisp.c (set_cursor_from_row): Fix cursor positioning when a | 3 | * xdisp.c (set_cursor_from_row): Fix cursor positioning when a |
| 4 | display property strides EOL and includes a newline, as in | 4 | display property strides EOL and includes a newline, as in |
| 5 | longlines-mode. (Bug#9254) | 5 | longlines-mode. (Bug#9254) |
| 6 | (move_it_in_display_line_to): Fix vertical-motion in a buffer with | ||
| 7 | word-wrap under bidirectional display. (Bug#9224) | ||
| 6 | 8 | ||
| 7 | * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE | 9 | * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE |
| 8 | is non-zero, even if the data buffer is NULL. Fixes a crash in | 10 | is non-zero, even if the data buffer is NULL. Fixes a crash in |
diff --git a/src/xdisp.c b/src/xdisp.c index 9c281c6736b..6e9474e3c10 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -8009,13 +8009,19 @@ move_it_in_display_line_to (struct it *it, | |||
| 8009 | positions smaller than TO_CHARPOS, return | 8009 | positions smaller than TO_CHARPOS, return |
| 8010 | MOVE_POS_MATCH_OR_ZV, like the unidirectional display | 8010 | MOVE_POS_MATCH_OR_ZV, like the unidirectional display |
| 8011 | did. */ | 8011 | did. */ |
| 8012 | if (it->bidi_p && (op & MOVE_TO_POS) != 0 | 8012 | if (it->bidi_p && (op & MOVE_TO_POS) != 0) |
| 8013 | && !saw_smaller_pos | ||
| 8014 | && IT_CHARPOS (*it) > to_charpos) | ||
| 8015 | { | 8013 | { |
| 8016 | if (IT_CHARPOS (ppos_it) < ZV) | 8014 | if (!saw_smaller_pos && IT_CHARPOS (*it) > to_charpos) |
| 8017 | RESTORE_IT (it, &ppos_it, ppos_data); | 8015 | { |
| 8018 | goto buffer_pos_reached; | 8016 | if (IT_CHARPOS (ppos_it) < ZV) |
| 8017 | RESTORE_IT (it, &ppos_it, ppos_data); | ||
| 8018 | goto buffer_pos_reached; | ||
| 8019 | } | ||
| 8020 | else if (it->line_wrap == WORD_WRAP && atpos_it.sp >= 0 | ||
| 8021 | && IT_CHARPOS (*it) > to_charpos) | ||
| 8022 | goto buffer_pos_reached; | ||
| 8023 | else | ||
| 8024 | result = MOVE_NEWLINE_OR_CR; | ||
| 8019 | } | 8025 | } |
| 8020 | else | 8026 | else |
| 8021 | result = MOVE_NEWLINE_OR_CR; | 8027 | result = MOVE_NEWLINE_OR_CR; |