Replies: 2 comments 6 replies
-
|
The problem I had seen was that if an inline overlay is shown after the input, it will have to update immediately on every key press such that the overlay is not shifted and letters which already exist at the beginning of the overlay are overridden. Example: Now the problem is that recomputing the candidates to recompute the overlay would be too costly. The candidate recomputation would have to happen in an non-interruptible way. One could however use a heuristic and simply delete the first letter from the overlay if it matches. Corfu right now does not have such a problem, since the popup is shown below and as such it doesn't hurt as much visually if the popup lags behind slightly until the user pauses a little bit. Corfu can compute the candidates and interrupt candidate computation. The second problem is that Corfu supports more flexible completion styles, not only prefix completion. What should the overlay display then? Example: It would maybe work if one first computes the full set of candidates and on additional input refine/refilter the sorted set of computed candidates given the new input. This way candidate computation would be fast, but could get incoherent if the full set of candidates are computed. As soon as TAB (or some other key) is pressed to display the full candidate list would be displayed and the top candidate would not match anymore the refined previewed candidate. One could look at the Emacs 30 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to implement
corfu-candidate-overlay-like preview styles. Since we already havecorfu-preview-currentnow, I only need to change the text properties(cursor and face) in the overlay. as in #331 , you mention that you didn't manage to achieve acceptable performance. I wonder the status of performance now, I thinkcompany-preview-frontenddoes the pretty same thing, updating the overlay on every keystroke.In corfu, the preview flickers at first, but it seems to be a redisplay issue instead of performance. the code deletes overlay in
pre-command-hookand then force redisplay before the new overlay is computed. Commenting out the following code eliminates the flickering, and I don't feel any lags during these days of usage.corfu/corfu.el
Line 705 in c302b05
It is related to #48. Could this be further optimized? maybe by changing the overlay update logic? or add another option here?
Beta Was this translation helpful? Give feedback.
All reactions