sebastiencs / company-box

A company front-end with icons
565 stars 64 forks source link

Render only visible candidates and remove company-box-mode-map #119

Closed sebastiencs closed 4 years ago

sebastiencs commented 4 years ago

This addresses #107. Render candidates only when they become visible. Performance should be improved.

company-box-max-candidates is now ignored and company-box-mode-map removed.

@kiennq Can you please try this branch and see if it's still slow.

@dgutov This PR assumes that the list of candidates changes only when company-prefix changes, is this correct ?

dgutov commented 4 years ago

This PR assumes that the list of candidates changes only when company-prefix changes, is this correct ?

Yes, but the selection can change, so you might have to re-render the list. But this action is amenable to optimization, if you want (IME, fully re-rendering 10 lines doesn't take a lot of time anyway).

sebastiencs commented 4 years ago

@dgutov Thanks, yes it will replace the buffer when company-prefix has changed. The selection is always taken into account, with and without a change in company-prefix

kiennq commented 4 years ago

@sebastiencs Thanks, it feels faster now.

sebastiencs commented 4 years ago

@kiennq Great, thanks for testing

zhenwenc commented 3 years ago

Hi @sebastiencs , after upgrating to the latest company-box, no completion candidate had been rendered, but only rendering a list of placeholders (empty strings), but docs and completions are working correctly.

https://github.com/sebastiencs/company-box/blob/be37a9a30dc112ab172af21af694e2cb04a74f85/company-box.el#L789-L790

Is it related to these changes? Thanks!