tumashu / vertico-posframe

GNU General Public License v3.0
106 stars 16 forks source link

Prompt flickers #3

Closed minad closed 2 years ago

minad commented 2 years ago

Hey @tumashu,

I just tried vertico-posframe and it seems to work well, much better than last time I tried posframe! However I found that the prompt flickers if you scroll quickly through the candidate list of e.g. M-x. Then the prompt string "M-x" flickers noticeably. No other parts of the UI flicker, besides some initial flicker at startup. Any idea what could be causing this prompt flicker and if it is fixable? Thanks!

minad commented 2 years ago

Btw, I also linked to your package from https://github.com/minad/vertico#child-frames-and-popups. I am still not recommending it unreservedly due to the flicker issues. ;)

tumashu commented 2 years ago

please try last code, maybe fixed :-)

minad commented 2 years ago

The prompt flicker is indeed gone, but now the cursor flickers badly. Please compare with https://github.com/minad/mini-popup, which does not have the issue.

One more thing I'd like to point out - you can be a bit more economical with your usage of advices, which will ultimately make your code more robust and less likely to break if I change something in Vertico:

https://github.com/tumashu/vertico-posframe/blob/7134c809d4b8966f1cab7f4f3a0fc6757ff42d7d/vertico-posframe.el#L324-L329

Instead of advising completing-read-default and completing-read-multiple and obtaining the window you can use minibuffer-selected-window. So these two advices are unnecessary. Then you install another post-command-hook. This hook should not be necessary since you replace the display function. The display function is executed at the end of the vertico--exhibit post-command-hook. You can move the code of your vertico-posframe--post-command-function to your vertico-posframe--display function.

tumashu commented 2 years ago
minibuffer-selected-window

good idea.

tumashu commented 2 years ago
You can move the code of your vertico-posframe--post-command-function to your vertico-posframe--display function

done.

tumashu commented 2 years ago
but now the cursor flickers badly.

I think this should improve :-)

minad commented 2 years ago

Works pretty well now and also looks good code wise. Thanks!