aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-01-04 15:37:16 +0200
committerEli Zaretskii2022-01-04 15:37:16 +0200
commit38b4bbb7e1abaa9f925048840b53290e2011a851 (patch)
treeac5e39b40a802a6d676c5bab624e5315508cd832
parentaa7d0e9a92228e40f63a86718de13ce5842137b3 (diff)
downloademacs-38b4bbb7e1abaa9f925048840b53290e2011a851.tar.gz
emacs-38b4bbb7e1abaa9f925048840b53290e2011a851.zip
A cleaner fix for display bug#52947
* src/xdisp.c (tab_bar_height, redisplay_tab_bar): Don't call set_iterator_to_next here... (display_tab_bar_line): ...call it here, even if we exit the loop because we encounter a newline.
-rw-r--r--src/xdisp.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 6e94ff5ec68..0635cad0d19 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13745,6 +13745,7 @@ display_tab_bar_line (struct it *it, int height)
13745 so there's no need to check the face here. */ 13745 so there's no need to check the face here. */
13746 it->start_of_box_run_p = true; 13746 it->start_of_box_run_p = true;
13747 13747
13748 bool enough = false;
13748 while (it->current_x < max_x) 13749 while (it->current_x < max_x)
13749 { 13750 {
13750 int x, n_glyphs_before, i, nglyphs; 13751 int x, n_glyphs_before, i, nglyphs;
@@ -13791,11 +13792,12 @@ display_tab_bar_line (struct it *it, int height)
13791 ++i; 13792 ++i;
13792 } 13793 }
13793 13794
13795 enough = ITERATOR_AT_END_OF_LINE_P (it);
13796 set_iterator_to_next (it, true);
13797
13794 /* Stop at line end. */ 13798 /* Stop at line end. */
13795 if (ITERATOR_AT_END_OF_LINE_P (it)) 13799 if (enough)
13796 break; 13800 break;
13797
13798 set_iterator_to_next (it, true);
13799 } 13801 }
13800 13802
13801 out:; 13803 out:;
@@ -13878,10 +13880,6 @@ tab_bar_height (struct frame *f, int *n_rows, bool pixelwise)
13878 { 13880 {
13879 it.glyph_row = temp_row; 13881 it.glyph_row = temp_row;
13880 display_tab_bar_line (&it, -1); 13882 display_tab_bar_line (&it, -1);
13881 /* If the tab-bar string includes newlines, get past it, because
13882 display_tab_bar_line doesn't. */
13883 if (ITERATOR_AT_END_OF_LINE_P (&it))
13884 set_iterator_to_next (&it, true);
13885 } 13883 }
13886 clear_glyph_row (temp_row); 13884 clear_glyph_row (temp_row);
13887 13885
@@ -14007,10 +14005,6 @@ redisplay_tab_bar (struct frame *f)
14007 extra -= h; 14005 extra -= h;
14008 } 14006 }
14009 display_tab_bar_line (&it, height + h); 14007 display_tab_bar_line (&it, height + h);
14010 /* If the tab-bar string includes newlines, get past it,
14011 because display_tab_bar_line doesn't. */
14012 if (ITERATOR_AT_END_OF_LINE_P (&it))
14013 set_iterator_to_next (&it, true);
14014 } 14008 }
14015 } 14009 }
14016 else 14010 else