Subject: Re: bug#38563: 27.0.50; Company popup renders with newlines (?) inheriting the bg properties of the character at next line's bol

From: Dmitry Gutov <[email-masked]>
Date: Fri, 13 Dec 2019 17:04:21 +0200

On 13.12.2019 16:12, Eli Zaretskii wrote:

>> But I suppose I could add a face with ':extend nil' and use it in place
>> of 'default' there.
> 
> It wouldn't have worked, because ':extend nil' means the face which
> says this is ineligible for face merging when face extension is
> considered.  IOW, ':extend nil' cannot countermand some other face
> that's being merged which says ':extend t'.

Hmm, that's counter to my intuition how this should work (meaning, 
:extend nil should be used during merging, like it's used during 
inheritance), but maybe this way enables functionality that wouldn't be 
possible otherwise.

>> ...but the background color is taken specifically from the face that
>> specified :extend?
> 
> The problem is that the company's tooltip faces don't say ':extend t',
> so they are ineligible for merging when the face beyond EOL is
> considered.

And we definitely wouldn't want the tooptil faces to say ':extend t'. Or 
else it would not be rectangular.

> The only face which was eligible was the face of the
> first character of the line where you place your overlay.  Even if it
> doesn't have ':extend t', we treat the base face (the first one being
> merged) specially: we always treat it as eligible (ever wondered how
> come 'default', 'tool-bar', and other "basic" faces get extended
> although they don't specify :extend?).

Um, okay. I suppose they have to be extended because we need to draw 
*something* at the place "occupied by" newline.

> The latest changes simply reset the :extend attribute of the "basic"
> face used in the merge process, since I believe this is expected in
> all the use cases (fingers crossed that no one comes with a valid use
> case where it's not TRT).

Fingers crossed.

Thanks.