diff options
| author | Eli Zaretskii | 2010-05-28 15:00:47 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-05-28 15:00:47 +0300 |
| commit | a85cde3870d61cb9cc6662e5ec6245f474146f7e (patch) | |
| tree | 35b7a11ca1848a1b739375772e807fa971ee980b /src | |
| parent | 0ad1627dbeb2c525a78252de500cb92ac367d8e2 (diff) | |
| download | emacs-a85cde3870d61cb9cc6662e5ec6245f474146f7e.tar.gz emacs-a85cde3870d61cb9cc6662e5ec6245f474146f7e.zip | |
Prevent unnecessary scrolling in bidi-reordered buffers.
xdisp.c (try_cursor_movement): back up to non-continuation line only
after finding point's row..
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 58 |
2 files changed, 36 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index eeee6540e68..a530e844bf9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-05-28 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (try_cursor_movement): Prevent unnecessary scrolling in | ||
| 4 | bidi-reordered buffers. | ||
| 5 | |||
| 1 | 2010-05-28 Kenichi Handa <handa@m17n.org> | 6 | 2010-05-28 Kenichi Handa <handa@m17n.org> |
| 2 | 7 | ||
| 3 | * font.c (font_delete_unmatched): Check Vface_ignored_fonts. | 8 | * font.c (font_delete_unmatched): Check Vface_ignored_fonts. |
diff --git a/src/xdisp.c b/src/xdisp.c index 31fa5f39d5f..a94049a780b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13763,32 +13763,6 @@ try_cursor_movement (window, startp, scroll_step) | |||
| 13763 | ++row; | 13763 | ++row; |
| 13764 | if (!row->enabled_p) | 13764 | if (!row->enabled_p) |
| 13765 | rc = CURSOR_MOVEMENT_MUST_SCROLL; | 13765 | rc = CURSOR_MOVEMENT_MUST_SCROLL; |
| 13766 | /* If rows are bidi-reordered, back up until we find a row | ||
| 13767 | that does not belong to a continuation line. This is | ||
| 13768 | because we must consider all rows of a continued line as | ||
| 13769 | candidates for cursor positioning, since row start and | ||
| 13770 | end positions change non-linearly with vertical position | ||
| 13771 | in such rows. */ | ||
| 13772 | /* FIXME: Revisit this when glyph ``spilling'' in | ||
| 13773 | continuation lines' rows is implemented for | ||
| 13774 | bidi-reordered rows. */ | ||
| 13775 | if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)) | ||
| 13776 | { | ||
| 13777 | while (MATRIX_ROW_CONTINUATION_LINE_P (row)) | ||
| 13778 | { | ||
| 13779 | xassert (row->enabled_p); | ||
| 13780 | --row; | ||
| 13781 | /* If we hit the beginning of the displayed portion | ||
| 13782 | without finding the first row of a continued | ||
| 13783 | line, give up. */ | ||
| 13784 | if (row <= w->current_matrix->rows) | ||
| 13785 | { | ||
| 13786 | rc = CURSOR_MOVEMENT_MUST_SCROLL; | ||
| 13787 | break; | ||
| 13788 | } | ||
| 13789 | |||
| 13790 | } | ||
| 13791 | } | ||
| 13792 | } | 13766 | } |
| 13793 | 13767 | ||
| 13794 | if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED) | 13768 | if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED) |
| @@ -13888,7 +13862,37 @@ try_cursor_movement (window, startp, scroll_step) | |||
| 13888 | rc = CURSOR_MOVEMENT_MUST_SCROLL; | 13862 | rc = CURSOR_MOVEMENT_MUST_SCROLL; |
| 13889 | } | 13863 | } |
| 13890 | else if (rc != CURSOR_MOVEMENT_SUCCESS | 13864 | else if (rc != CURSOR_MOVEMENT_SUCCESS |
| 13891 | && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) | 13865 | && !NILP (XBUFFER (w->buffer)->bidi_display_reordering)) |
| 13866 | { | ||
| 13867 | /* If rows are bidi-reordered and point moved, back up | ||
| 13868 | until we find a row that does not belong to a | ||
| 13869 | continuation line. This is because we must consider | ||
| 13870 | all rows of a continued line as candidates for the | ||
| 13871 | new cursor positioning, since row start and end | ||
| 13872 | positions change non-linearly with vertical position | ||
| 13873 | in such rows. */ | ||
| 13874 | /* FIXME: Revisit this when glyph ``spilling'' in | ||
| 13875 | continuation lines' rows is implemented for | ||
| 13876 | bidi-reordered rows. */ | ||
| 13877 | while (MATRIX_ROW_CONTINUATION_LINE_P (row)) | ||
| 13878 | { | ||
| 13879 | xassert (row->enabled_p); | ||
| 13880 | --row; | ||
| 13881 | /* If we hit the beginning of the displayed portion | ||
| 13882 | without finding the first row of a continued | ||
| 13883 | line, give up. */ | ||
| 13884 | if (row <= w->current_matrix->rows) | ||
| 13885 | { | ||
| 13886 | rc = CURSOR_MOVEMENT_CANNOT_BE_USED; | ||
| 13887 | break; | ||
| 13888 | } | ||
| 13889 | |||
| 13890 | } | ||
| 13891 | } | ||
| 13892 | if (rc == CURSOR_MOVEMENT_SUCCESS | ||
| 13893 | || rc == CURSOR_MOVEMENT_CANNOT_BE_USED) | ||
| 13894 | ; | ||
| 13895 | else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) | ||
| 13892 | && make_cursor_line_fully_visible_p) | 13896 | && make_cursor_line_fully_visible_p) |
| 13893 | { | 13897 | { |
| 13894 | if (PT == MATRIX_ROW_END_CHARPOS (row) | 13898 | if (PT == MATRIX_ROW_END_CHARPOS (row) |