[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inline completion preview

From: Dmitry Gutov
Subject: Re: Inline completion preview
Date: Mon, 30 Oct 2023 15:20:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 30/10/2023 14:42, Alexander Adolf wrote:
Also company works on TTY Emacs out of the box, and I think Corfu
doesn't.  More stuff to add in.
Corfu works with TTY Emacs of of the box, too.

Are you sure you don't have corfu-terminal installed?

It's in NonGNU ELPA because it uses the 'popon' package which doesn't have its copyright assigned to FSF, and thus couldn't be included with Emacs until that happens.

Under a graphical environment, corfu uses a frame provided by the
graphical environment (for instance the window manager) to display the
candidates. That way the display of the "popover" is independent of the
fonts used in the buffer. Consider as an example an Org buffer, where
the headings are rendered in a bigger font. Company will render popvover
text in that area using the bigger font.

Result with company:

        The quick brown fox jum
                               | candidate 1 |
        * BIG FONT HEADING      | CANDIDATE 2    |
          BIG FONT HEADING      | CANDIDATE 2    |
                               | candidate 3 |
                               | candidate 4 |

Duh! Company certainly showing its age here.

Result with corfu:

        The quick brown fox jum
                               | candidate 1 |
        * BIG FONT HEADING     | candidate 2 |
          BIG FONT HEADING     | candidate 3 |
                               | candidate 4 |

You can try out this branch: https://github.com/company-mode/company-mode/pull/1394

It should deal with big fonts, as well as multiple width characters, fine. The only thing that seems impossible to implement is compatibility with line numbering. Perhaps I'll someday switch to popon/popup.el's approach of one-overlay-per-line when I have more time.

If 'popon' were in GNU ELPA, however, Company could also use it. In fact, writing a frontend using it for your own purpose should already be easy enough.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]