From: Eli Zaretskii Date: Tue, 4 Jan 2022 13:37:16 +0000 (+0200) Subject: A cleaner fix for display bug#52947 X-Git-Tag: emacs-29.0.90~3258 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38b4bbb7e1abaa9f925048840b53290e2011a851;p=emacs.git 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. --- 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) so there's no need to check the face here. */ it->start_of_box_run_p = true; + bool enough = false; while (it->current_x < max_x) { int x, n_glyphs_before, i, nglyphs; @@ -13791,11 +13792,12 @@ display_tab_bar_line (struct it *it, int height) ++i; } + enough = ITERATOR_AT_END_OF_LINE_P (it); + set_iterator_to_next (it, true); + /* Stop at line end. */ - if (ITERATOR_AT_END_OF_LINE_P (it)) + if (enough) break; - - set_iterator_to_next (it, true); } out:; @@ -13878,10 +13880,6 @@ tab_bar_height (struct frame *f, int *n_rows, bool pixelwise) { it.glyph_row = temp_row; display_tab_bar_line (&it, -1); - /* If the tab-bar string includes newlines, get past it, because - display_tab_bar_line doesn't. */ - if (ITERATOR_AT_END_OF_LINE_P (&it)) - set_iterator_to_next (&it, true); } clear_glyph_row (temp_row); @@ -14007,10 +14005,6 @@ redisplay_tab_bar (struct frame *f) extra -= h; } display_tab_bar_line (&it, height + h); - /* If the tab-bar string includes newlines, get past it, - because display_tab_bar_line doesn't. */ - if (ITERATOR_AT_END_OF_LINE_P (&it)) - set_iterator_to_next (&it, true); } } else