Commit 26cdf528 authored by Eli Zaretskii's avatar Eli Zaretskii

Mirror continuation indicators for R2L lines; fix face extension on TTY.

 xdisp.c (extend_face_to_end_of_line): Fix face extension at ZV.
 term.c (produce_special_glyphs): Mirror the backslash
 continuation character in R2L lines.
 xdisp.c (set_cursor_from_row, display_line): Use
 MATRIX_ROW_CONTINUATION_LINE_P instead of testing value of
 row->continuation_lines_width.
 fringe.c (update_window_fringes): For R2L rows, swap the bitmaps
 of continuation indicators on the fringes.
parent 45903529
2010-04-17 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (extend_face_to_end_of_line): Fix face extension at ZV.
* term.c (produce_special_glyphs): Mirror the backslash
continuation character in R2L lines.
* xdisp.c (set_cursor_from_row, display_line): Use
MATRIX_ROW_CONTINUATION_LINE_P instead of testing value of
row->continuation_lines_width.
* fringe.c (update_window_fringes): For R2L rows, swap the bitmaps
of continuation indicators on the fringes.
* xdisp.c (next_element_from_buffer): Don't call
bidi_paragraph_init if we are at ZV. Fixes a crash when reseated to
ZV by try_window_reusing_current_matrix.
......
......@@ -1090,7 +1090,8 @@ update_window_fringes (w, keep_current_p)
: LEFT_FRINGE (2, Qtop, 0));
else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
left = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
else if ((!row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row))
|| (row->reversed_p && row->continued_p))
left = LEFT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
left = LEFT_FRINGE (5, Qempty_line, 0);
......@@ -1117,7 +1118,8 @@ update_window_fringes (w, keep_current_p)
: RIGHT_FRINGE (2, Qtop, 0));
else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
right = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
else if (row->continued_p)
else if ((!row->reversed_p && row->continued_p)
|| (row->reversed_p && MATRIX_ROW_CONTINUATION_LINE_P (row)))
right = RIGHT_FRINGE (4, Qcontinuation, 0);
else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
right = RIGHT_FRINGE (6, Qup, 0);
......
......@@ -1889,12 +1889,16 @@ produce_special_glyphs (it, what)
if (what == IT_CONTINUATION)
{
/* Continuation glyph. */
SET_GLYPH_FROM_CHAR (glyph, '\\');
/* Continuation glyph. For R2L lines, we mirror it by hand. */
if (it->bidi_it.paragraph_dir == R2L)
SET_GLYPH_FROM_CHAR (glyph, '/');
else
SET_GLYPH_FROM_CHAR (glyph, '\\');
if (it->dp
&& (gc = DISP_CONTINUE_GLYPH (it->dp), GLYPH_CODE_P (gc))
&& GLYPH_CODE_CHAR_VALID_P (gc))
{
/* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
......@@ -1907,6 +1911,7 @@ produce_special_glyphs (it, what)
&& (gc = DISP_TRUNC_GLYPH (it->dp), GLYPH_CODE_P (gc))
&& GLYPH_CODE_CHAR_VALID_P (gc))
{
/* FIXME: Should we mirror GC for R2L lines? */
SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);
spec_glyph_lookup_face (XWINDOW (it->window), &glyph);
}
......
......@@ -12949,7 +12949,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
/* that candidate is not the row we are processing */
&& MATRIX_ROW (matrix, w->cursor.vpos) != row
/* the row we are processing is part of a continued line */
&& (row->continued_p || row->continuation_lines_width)
&& (row->continued_p || MATRIX_ROW_CONTINUATION_LINE_P (row))
/* Make sure cursor.vpos specifies a row whose start and end
charpos occlude point. This is because some callers of this
function leave cursor.vpos at the row where the cursor was
......@@ -16876,9 +16876,9 @@ extend_face_to_end_of_line (it)
saved_avoid_cursor = it->avoid_cursor_p;
it->avoid_cursor_p = 1;
saved_face_id = it->face_id;
/* The last row should get the default face, to avoid
painting the rest of the window with the region face,
if the region ends at ZV. */
/* The last row's stretch glyph should get the default
face, to avoid painting the rest of the window with
the region face, if the region ends at ZV. */
if (it->glyph_row->ends_at_zv_p)
it->face_id = DEFAULT_FACE_ID;
else
......@@ -16909,7 +16909,13 @@ extend_face_to_end_of_line (it)
it->object = make_number (0);
it->c = ' ';
it->len = 1;
it->face_id = face->id;
/* The last row's blank glyphs should get the default face, to
avoid painting the rest of the window with the region face,
if the region ends at ZV. */
if (it->glyph_row->ends_at_zv_p)
it->face_id = DEFAULT_FACE_ID;
else
it->face_id = face->id;
PRODUCE_GLYPHS (it);
......@@ -17810,7 +17816,7 @@ display_line (it)
*it = save_it;
}
else if (!row->continued_p
&& row->continuation_lines_width
&& MATRIX_ROW_CONTINUATION_LINE_P (row)
&& it->eol_pos.charpos > 0)
{
/* Last row of a continued line. Use the position
......
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