Commit a85cde38 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Prevent unnecessary scrolling in bidi-reordered buffers.

 xdisp.c (try_cursor_movement): back up to non-continuation line only
 after finding point's row..
parent 0ad1627d
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> 2010-05-28 Kenichi Handa <handa@m17n.org>
   
* font.c (font_delete_unmatched): Check Vface_ignored_fonts. * font.c (font_delete_unmatched): Check Vface_ignored_fonts.
......
...@@ -13763,32 +13763,6 @@ try_cursor_movement (window, startp, scroll_step) ...@@ -13763,32 +13763,6 @@ try_cursor_movement (window, startp, scroll_step)
++row; ++row;
if (!row->enabled_p) if (!row->enabled_p)
rc = CURSOR_MOVEMENT_MUST_SCROLL; 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) if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED)
...@@ -13888,7 +13862,37 @@ try_cursor_movement (window, startp, scroll_step) ...@@ -13888,7 +13862,37 @@ try_cursor_movement (window, startp, scroll_step)
rc = CURSOR_MOVEMENT_MUST_SCROLL; rc = CURSOR_MOVEMENT_MUST_SCROLL;
} }
else if (rc != CURSOR_MOVEMENT_SUCCESS 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) && make_cursor_line_fully_visible_p)
{ {
if (PT == MATRIX_ROW_END_CHARPOS (row) if (PT == MATRIX_ROW_END_CHARPOS (row)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment