Subject: 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: Wed, 18 Dec 2019 22:37:49 +0200

On 16.12.2019 17:49, Eli Zaretskii wrote:

> Unfortunately, in bug#38633 in turned out my "fix" was not really a
> fix, but a stupid typo, which just happened to stop the problem in
> this bug from happening, but caused serious breakage elsewhere.
> 
> So I'm reopening this bug, and will have to think of a better
> solution.

In case you don't find it, how about we put 'default' as the 'face' 
property of the overlay? That seems to work.

And with that we can stop appending 'default' to all 'face' values in 
the overlay string.

WDYT?

diff --git a/company.el b/company.el
index 80398a3..399e9ea 100644
--- a/company.el
+++ b/company.el
@@ -2939,6 +2939,7 @@ Returns a negative number if the tooltip should be 
displayed above point."
            (overlay-put ov 'display disp)
          (overlay-put ov 'after-string disp)
          (overlay-put ov 'invisible t))
+      (overlay-put ov 'face 'default)
        (overlay-put ov 'window (selected-window)))))

  (defun company-pseudo-tooltip-guard ()