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.
This commit is contained in:
Eli Zaretskii
2022-01-04 15:37:16 +02:00
parent aa7d0e9a92
commit 38b4bbb7e1

View File

@@ -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;
}
/* Stop at line end. */
if (ITERATOR_AT_END_OF_LINE_P (it))
break;
enough = ITERATOR_AT_END_OF_LINE_P (it);
set_iterator_to_next (it, true);
/* Stop at line end. */
if (enough)
break;
}
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