Subject: Re: bug#37667: 27.0.50; Tab Bar display problems with more than 5 tabs

From: Juri Linkov <[email-masked]>
Date: Thu, 31 Oct 2019 02:03:51 +0200

>> I don't want to modify display_string to take the tab-line
>> into account because more logic for searching the current tab
>> needs to be implemented anyway.
>
> Searching the current tab and displaying truncation indicators are two
> separate tasks that don't necessarily need the same (or even similar)
> code.  The former could be found much easier, I think.

Before starting to search the current tab, the code needs to known
whether truncation really occurred.

>> So maybe better to copy code from display_string to a new function
>> tab_visible_in_tab_line, and beside detection of truncation also add
>> more code to detect a situation when the current tab is not visible
>> due to truncation.
>
> I don't think these two jobs are similar enough, but maybe I don't
> understand well enough what you have in mind.  Can you elaborate how
> you intended to search for the current tab?

We need to detect whether the current tab is before the right truncation point
(so it is visible), or after the truncation (so the current tab is not visible).

It seems searching for the current tab is not possible in the glyph matrix,
because when the current tab is after the truncation point, then its
glyphs are not produced.

Then the code for searching the current tab should be similar to
display_string but without producing glyphs.