Prevent unnecessary scrolling in bidi-reordered buffers.

xdisp.c (try_cursor_movement): back up to non-continuation line only
 after finding point's row..
This commit is contained in:
Eli Zaretskii 2010-05-28 15:00:47 +03:00
parent 0ad1627dbe
commit a85cde3870
2 changed files with 36 additions and 27 deletions

View file

@ -1,3 +1,8 @@
2010-05-28 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (try_cursor_movement): Prevent unnecessary scrolling in
bidi-reordered buffers.
2010-05-28 Kenichi Handa <handa@m17n.org>
* font.c (font_delete_unmatched): Check Vface_ignored_fonts.

View file

@ -13763,32 +13763,6 @@ try_cursor_movement (window, startp, scroll_step)
++row;
if (!row->enabled_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
/* If rows are bidi-reordered, back up until we find a row
that does not belong to a continuation line. This is
because we must consider all rows of a continued line as
candidates for cursor positioning, since row start and
end positions change non-linearly with vertical position
in such rows. */
/* FIXME: Revisit this when glyph ``spilling'' in
continuation lines' rows is implemented for
bidi-reordered rows. */
if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
{
while (MATRIX_ROW_CONTINUATION_LINE_P (row))
{
xassert (row->enabled_p);
--row;
/* If we hit the beginning of the displayed portion
without finding the first row of a continued
line, give up. */
if (row <= w->current_matrix->rows)
{
rc = CURSOR_MOVEMENT_MUST_SCROLL;
break;
}
}
}
}
if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED)
@ -13888,7 +13862,37 @@ try_cursor_movement (window, startp, scroll_step)
rc = CURSOR_MOVEMENT_MUST_SCROLL;
}
else if (rc != CURSOR_MOVEMENT_SUCCESS
&& MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
&& !NILP (XBUFFER (w->buffer)->bidi_display_reordering))
{
/* If rows are bidi-reordered and point moved, back up
until we find a row that does not belong to a
continuation line. This is because we must consider
all rows of a continued line as candidates for the
new cursor positioning, since row start and end
positions change non-linearly with vertical position
in such rows. */
/* FIXME: Revisit this when glyph ``spilling'' in
continuation lines' rows is implemented for
bidi-reordered rows. */
while (MATRIX_ROW_CONTINUATION_LINE_P (row))
{
xassert (row->enabled_p);
--row;
/* If we hit the beginning of the displayed portion
without finding the first row of a continued
line, give up. */
if (row <= w->current_matrix->rows)
{
rc = CURSOR_MOVEMENT_CANNOT_BE_USED;
break;
}
}
}
if (rc == CURSOR_MOVEMENT_SUCCESS
|| rc == CURSOR_MOVEMENT_CANNOT_BE_USED)
;
else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
&& make_cursor_line_fully_visible_p)
{
if (PT == MATRIX_ROW_END_CHARPOS (row)