Subject: Re: bug#27427: 26.0.50; Native line numbers lead to display error in company-mode popup

From: Dmitry Gutov <[email-masked]>
Date: Wed, 21 Jun 2017 16:04:58 +0300

On 6/21/17 5:40 AM, Eli Zaretskii wrote:

>> When the position at bol is interpreted as "column 3", all lines of the
>> rectangle are rendered starting with the fourth character of each line.
> 
> So this is the root cause of the problem.  Is there a reason not to
> start rendering from the character whose posn-col-row is 3?

How?

Does that mean I'll have to call posn-at-point twice now? Once for 
point, and once for beginning-of-visual-line?

Even that won't solve all the rendering issues. In my testing, the first 
line of the popup is not at the same column as the rest of them. 
Probably because of the `line-prefix' property on the overlay which I 
explained in the previous email. And we can't stop putting it there 
because we don't have a better solution for the `line-prefix' text property.

I _guess_ I could reorganize the code and track whether the current line 
is the first, and render that line of the popup with a different 
offset... Doesn't sound great, to be honest. That's an extra piece of 
complexity.

Even so, I'm not sure this will be the end of it. Setting line-prefix 
doesn't seem to be an accurate model of the problem company popup has 
with native line numbering:

- The image in the report shows the first line of the popup being 
"rendered" at a higher column than the rest. The rest are basically 
positioned fine.

- In my testing, with (setq line-prefix "..."), it's the opposite. The 
first line of the popup is positioned correctly, while the rest are 
shifted to the right by 3 columns.