changeset 107994:5dc04900cbd7

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.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 17 Apr 2010 15:33:05 +0300
parents 7a57ff6ef75c
children 1afd4d56683f
files src/ChangeLog src/fringe.c src/term.c src/xdisp.c
diffstat 4 files changed, 35 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Apr 17 13:29:40 2010 +0300
+++ b/src/ChangeLog	Sat Apr 17 15:33:05 2010 +0300
@@ -1,5 +1,17 @@
 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.
--- a/src/fringe.c	Sat Apr 17 13:29:40 2010 +0300
+++ b/src/fringe.c	Sat Apr 17 15:33:05 2010 +0300
@@ -1090,7 +1090,8 @@
 		: 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 @@
 		 : 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);
--- a/src/term.c	Sat Apr 17 13:29:40 2010 +0300
+++ b/src/term.c	Sat Apr 17 15:33:05 2010 +0300
@@ -1889,12 +1889,16 @@
 
   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 @@
 	  && (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);
 	}
--- a/src/xdisp.c	Sat Apr 17 13:29:40 2010 +0300
+++ b/src/xdisp.c	Sat Apr 17 15:33:05 2010 +0300
@@ -12949,7 +12949,7 @@
       /* 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 @@
 	      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 @@
       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 @@
 	      *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