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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 14 Jul 2017 09:11:20 +0300

> From: Dmitry Gutov <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Fri, 14 Jul 2017 02:04:21 +0300
> 
> What doesn't work well is that the popup "background" gets displaced to 
> the left by the width of the numbers column, when rendered using the 
> popup overlay. Background meaning the contents of all the lines behind 
> the popup. And that happens because the line number glyphs are gone for 
> those specific lines, and we can't pad them without knowing the width of 
> the numbers column.

You could use the new function line-number-display-width to obtain
that information.

> Now, I've come upon this idea of a trivial patch. What do you think, 
> Eli? It seems to work perfectly, even though I'm struggling to 
> understand how this might happen under the covers. Is it brittle?

No, it isn't brittle.  What are you struggling to understand?  Maybe I
can help.