aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2019-09-15 23:40:47 +0300
committerJuri Linkov2019-09-15 23:40:47 +0300
commit8d30e1bce3c1bddf85272fa31b7d314ed421d29e (patch)
tree7c35b44839ada2044fc03e6be61d7cd4d4fbfca9
parent89ef791c07637953f514c0ead2f5935ac41ebc33 (diff)
downloademacs-8d30e1bce3c1bddf85272fa31b7d314ed421d29e.tar.gz
emacs-8d30e1bce3c1bddf85272fa31b7d314ed421d29e.zip
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)
-rw-r--r--src/xdisp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 9f999c79031..e2a4df1c008 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12740,7 +12740,7 @@ display_tab_bar (struct window *w)
12740 /* Display the item, pad with one space. */ 12740 /* Display the item, pad with one space. */
12741 if (it.current_x < it.last_visible_x) 12741 if (it.current_x < it.last_visible_x)
12742 display_string (NULL, string, Qnil, 0, 0, &it, 12742 display_string (NULL, string, Qnil, 0, 0, &it,
12743 SCHARS (string) + 1, 0, 0, -1); 12743 SCHARS (string) + 1, 0, 0, STRING_MULTIBYTE (string));
12744 } 12744 }
12745 12745
12746 /* Fill out the line with spaces. */ 12746 /* Fill out the line with spaces. */
@@ -12947,7 +12947,8 @@ tab_bar_height (struct frame *f, int *n_rows, bool pixelwise)
12947 temp_row->reversed_p = false; 12947 temp_row->reversed_p = false;
12948 it.first_visible_x = 0; 12948 it.first_visible_x = 0;
12949 it.last_visible_x = WINDOW_PIXEL_WIDTH (w); 12949 it.last_visible_x = WINDOW_PIXEL_WIDTH (w);
12950 reseat_to_string (&it, NULL, f->desired_tab_bar_string, 0, 0, 0, -1); 12950 reseat_to_string (&it, NULL, f->desired_tab_bar_string,
12951 0, 0, 0, STRING_MULTIBYTE (f->desired_tab_bar_string));
12951 it.paragraph_embedding = L2R; 12952 it.paragraph_embedding = L2R;
12952 12953
12953 while (!ITERATOR_AT_END_P (&it)) 12954 while (!ITERATOR_AT_END_P (&it))
@@ -13023,7 +13024,8 @@ redisplay_tab_bar (struct frame *f)
13023 13024
13024 /* Build a string that represents the contents of the tab-bar. */ 13025 /* Build a string that represents the contents of the tab-bar. */
13025 build_desired_tab_bar_string (f); 13026 build_desired_tab_bar_string (f);
13026 reseat_to_string (&it, NULL, f->desired_tab_bar_string, 0, 0, 0, -1); 13027 reseat_to_string (&it, NULL, f->desired_tab_bar_string, 0, 0, 0,
13028 STRING_MULTIBYTE (f->desired_tab_bar_string));
13027 /* FIXME: This should be controlled by a user option. But it 13029 /* FIXME: This should be controlled by a user option. But it
13028 doesn't make sense to have an R2L tab bar if the menu bar cannot 13030 doesn't make sense to have an R2L tab bar if the menu bar cannot
13029 be drawn also R2L, and making the menu bar R2L is tricky due 13031 be drawn also R2L, and making the menu bar R2L is tricky due