]> git.eshelyaron.com Git - emacs.git/commitdiff
Test and debug find_row_edges on TTY display.
authorEli Zaretskii <eliz@gnu.org>
Sat, 22 May 2010 12:38:26 +0000 (15:38 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 22 May 2010 12:38:26 +0000 (15:38 +0300)
 xdisp.c (find_row_edges): Handle the case of characters
 delivered from display vector.  Fix tests related to it->method.

src/ChangeLog
src/xdisp.c

index 1947f9598f0447343de42dbc8f5daba324ae712c..d4c072b1fab879be44887759d7f11da3c7e2bb03 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-22  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (find_row_edges): Handle the case of characters
+       delivered from display vector.  Fix tests related to it->method.
+
 2010-05-19  Eli Zaretskii  <eliz@gnu.org>
 
        * .gdbinit (prowlims): Display row->minpos and row->maxpos.
index 47c08d0df7943844888a8e6728c9d34d47ea3482..47c4945c9dc0aab67f7ebc039594bc8dc6d55239 100644 (file)
@@ -17538,7 +17538,9 @@ find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos)
      Line is continued from buffer            max_pos + 1
      Line ends in a newline from string       max_pos
      Line is continued from string            max_pos
+     Line is continued from display vector    max_pos
      Line is entirely from a string           min_pos == max_pos
+     Line is entirely from a display vector   min_pos == max_pos
      Line that ends at ZV                     ZV
 
      If you discover other use-cases, please add them here as
@@ -17547,21 +17549,27 @@ find_row_edges (it, row, min_pos, min_bpos, max_pos, max_bpos)
     row->maxpos = it->current.pos;
   else if (row->used[TEXT_AREA])
     {
-      if (CHARPOS (it->eol_pos) > 0)
+      if (row->ends_in_newline_from_string_p)
+       SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
+      else if (CHARPOS (it->eol_pos) > 0)
        SET_TEXT_POS (row->maxpos,
                      CHARPOS (it->eol_pos) + 1, BYTEPOS (it->eol_pos) + 1);
       else if (row->continued_p)
        {
-         if (it->method == GET_FROM_BUFFER)
+         /* If max_pos is different from IT's current position, it
+            means IT->method does not belong to the display element
+            at max_pos.  However, it also means that the display
+            element at max_pos was displayed in its entirety on this
+            line, which is equivalent to saying that the next line
+            starts at the next buffer position.  */
+         if (IT_CHARPOS (*it) == max_pos && it->method != GET_FROM_BUFFER)
+           SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
+         else
            {
              INC_BOTH (max_pos, max_bpos);
              SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
            }
-         else
-           SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
        }
-      else if (row->ends_in_newline_from_string_p)
-       SET_TEXT_POS (row->maxpos, max_pos, max_bpos);
       else if (max_pos == min_pos && it->method != GET_FROM_BUFFER)
        /* A line that is entirely from a string/image/stretch...  */
        row->maxpos = row->minpos;