Closed okamsn closed 9 months ago
This looks quite solid to me. I suggest to move most of the remember code (the hooks etc) to prescient.el and then only configure the trigger commands in vertico-prescient.el, such that the generic parts are reusable and the integration packages are as thin as possible.
Thank you for the PR!
I can confirm that this fixes the unexpected behavior I pointed out in #155.
This looks quite solid to me. I suggest to move most of the remember code (the hooks etc) to prescient.el and then only configure the trigger commands in vertico-prescient.el, such that the generic parts are reusable and the integration packages are as thin as possible.
I will try that. There is the new completions-sort
variable, so maybe the default UI can finally support Prescient.
This looks quite solid to me. I suggest to move most of the remember code (the hooks etc) to prescient.el and then only configure the trigger commands in vertico-prescient.el, such that the generic parts are reusable and the integration packages are as thin as possible.
I will try that. There is the new
completions-sort
variable, so maybe the default UI can finally support Prescient.
For time reasons, I've decided to investigate simplifying that part later in favor of fixing this particular bug now. Does anyone want any changes to how this is written, outside of generalizing it later?
Fix #155, remembering candidates when entering a new directory with
vertico-directory-enter
.Remember candidates on minibuffer exit as well as candidate insertion.
Remove
vertico-prescient--remember
.Add
vertico-prescient--remember-minibuffer-contents
. If completing a file name, only remember the last component of the file path, since that is the actual candidate. If the candidate is a directory, include the trailing directory separator.Add
vertico-prescient--insertion-commands
andvertico-prescient--remember-inserted-candidate
for remembering inpost-command-hook
.Add
vertico-prescient--remember-exited-candidate
andvertico-prescient--exit-commands
for remembering inminibuffer-exit-hook
.Hook
vertico-prescient--setup-remembrance
intominibuffer-setup-hook
.