emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] feature/tabs 8d30e1b 1/2: Fix assertion violations due to


From: Juri Linkov
Subject: [Emacs-diffs] feature/tabs 8d30e1b 1/2: Fix assertion violations due to non-ASCII text in tabs
Date: Sun, 15 Sep 2019 18:10:17 -0400 (EDT)

branch: feature/tabs
commit 8d30e1bce3c1bddf85272fa31b7d314ed421d29e
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    Fix assertion violations due to non-ASCII text in tabs
    
    * src/xdisp.c (tab_bar_height, redisplay_tab_bar)
    (display_tab_bar): If the Lisp string to be displayed in the
    tab-bar window is multibyte, tell the display
    engine to treat it as multibyte, instead of relying on the
    initial determination by init_iterator (which is based on the
    multibyteness of the current buffer).  (Bug#37385)
---
 src/xdisp.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 9f999c7..e2a4df1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12740,7 +12740,7 @@ display_tab_bar (struct window *w)
       /* Display the item, pad with one space.  */
       if (it.current_x < it.last_visible_x)
        display_string (NULL, string, Qnil, 0, 0, &it,
-                       SCHARS (string) + 1, 0, 0, -1);
+                       SCHARS (string) + 1, 0, 0, STRING_MULTIBYTE (string));
     }
 
   /* Fill out the line with spaces.  */
@@ -12947,7 +12947,8 @@ tab_bar_height (struct frame *f, int *n_rows, bool 
pixelwise)
   temp_row->reversed_p = false;
   it.first_visible_x = 0;
   it.last_visible_x = WINDOW_PIXEL_WIDTH (w);
-  reseat_to_string (&it, NULL, f->desired_tab_bar_string, 0, 0, 0, -1);
+  reseat_to_string (&it, NULL, f->desired_tab_bar_string,
+                    0, 0, 0, STRING_MULTIBYTE (f->desired_tab_bar_string));
   it.paragraph_embedding = L2R;
 
   while (!ITERATOR_AT_END_P (&it))
@@ -13023,7 +13024,8 @@ redisplay_tab_bar (struct frame *f)
 
   /* Build a string that represents the contents of the tab-bar.  */
   build_desired_tab_bar_string (f);
-  reseat_to_string (&it, NULL, f->desired_tab_bar_string, 0, 0, 0, -1);
+  reseat_to_string (&it, NULL, f->desired_tab_bar_string, 0, 0, 0,
+                    STRING_MULTIBYTE (f->desired_tab_bar_string));
   /* FIXME: This should be controlled by a user option.  But it
      doesn't make sense to have an R2L tab bar if the menu bar cannot
      be drawn also R2L, and making the menu bar R2L is tricky due



reply via email to

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