emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test to determine character left-overhangs a tab stretch.


From: Keith David Bershatsky
Subject: Re: Test to determine character left-overhangs a tab stretch.
Date: Tue, 13 Nov 2018 12:57:08 -0800

Thank you Eli for helping out with this particular issue.  I think the problem 
is that first_glyph->type (in the following test) is sometimes invalid and that 
is what causes the crash.  The test is designed to skip over the area of code 
when a tab stretch would normally be drawn anew due to the next glyph having a 
left overhang.

Last Commit : Tue Nov 13 22:01:57 2018 +0200
            : Eli Zaretskii <address@hidden>
            : 4a5a17507fe1e12ee02c174350edc479fb01ac01
            : Fix recent change in fileio.c

diff --git a/src/xdisp.c b/src/xdisp.c
index fa7691c..198a516 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -26841,7 +26841,45 @@ draw_glyphs (struct window *w, int x, struct glyph_row 
*row,
         prepended must be drawn because the first glyph string
         draws over it.  */
       i = left_overwritten (head);
-      if (i >= 0)
+
+
+/* *************************************************************************** 
*/
+/* MULTIPLE CURSORS */
+
+      bool skip_p = false;
+      int beg = i;
+
+      if (hl == DRAW_CURSOR)
+        while (beg < start)
+          {
+            struct glyph *first_glyph = (row)->glyphs[area] + beg;
+            if (first_glyph != NULL
+                && first_glyph->type != NULL)
+              {
+                 switch (first_glyph->type)
+                {
+                  case CHAR_GLYPH:
+                    break;
+                  case COMPOSITE_GLYPH:
+                    break;
+                  case STRETCH_GLYPH:
+                    {
+                      skip_p = true;
+                      break;
+                    }
+                  case IMAGE_GLYPH:
+                    break;
+                }
+              }
+            beg += 1;
+          }
+
+      if (i >= 0
+          && !skip_p)
+
+/* *************************************************************************** 
*/
+
+
        {
          enum draw_glyphs_face overlap_hl;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]