Closed TikhonJelvis closed 2 years ago
Ah, after using my fix for a bit longer, I think I found the reason for the check—seems that without it, a window briefly pops up in the wrong place before being populated and moved to where it should be.
For now that's still better than the error I was getting earlier, but I can investigate a bit more and see if there's a fix that doesn't create this problem.
Oh, never mind, the window flickering issue is present either way—I guess it's an artifact of my posframe configuration that I just never noticed before modifying and testing the code in this PR. The problem remains with or without the change in this PR.
I'll have to investigate that separately. In the meantime, the change in this PR fixes the problem I was seeing. I've been using the modification from this PR for a few hours of active work in Emacs now and it has been working well.
Thank you. I opted to just make sure the buffer exists in #587. The behavior of not displaying the buffer until it has candidates has been kept since it seems intentional, but the problem itself should be fixed.
Awesome, thanks for the fix. Sounds like you've thought through how to fix the error while minimizing changes that could affect anything else—better than the workaround I came up with :)
This fixes the error described in #571.
When using
selectrum-display-action
,selectrum--update
would raise the following error when the candidate list is empty (eg callingfind-file
from an empty directory):Poking around in
selectrum.el
, I found this happens becauseselectrum--update
usesselectrum--display-action-buffer
:selectrum--display-action-buffer
is created inselectrum--get-display-window
, butselectrum--update
explicitly does not callselectrum--get-display-window
when the candidate list is empty:With my setup, removing the check fixes the problem.
I'm not sure if this is a general solution—I assume the check is there for a reason, but I don't know what that is :).