]> git.eshelyaron.com Git - emacs.git/commitdiff
Mirror continuation indicators for R2L lines; fix face extension on TTY.
authorEli Zaretskii <eliz@gnu.org>
Sat, 17 Apr 2010 12:33:05 +0000 (15:33 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 17 Apr 2010 12:33:05 +0000 (15:33 +0300)
 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.

src/ChangeLog
src/fringe.c
src/term.c
src/xdisp.c

index 3d5ba0451689b5d2ad322175a80104eb746ce41b..8decf682bb8db35dc60bf62c36f7f4a7e03d14c3 100644 (file)
@@ -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.
index 335dde03c8ad96084df85902d2c865fd289faba6..cfb944d58d172524cb387b7bb8845f5a3cdf8d80 100644 (file)
@@ -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);
index 718a20d4164d849af0b6be8cf36d8464184c14f9..31e0ad223dbffaf117c4b5b90c91bfd608c0b6ef 100644 (file)
@@ -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);
        }
index b278538f62542f92022473d4b3d4e2a2f2c2355e..475a83449a667248701030b33490aa62365391b3 100644 (file)
@@ -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