radian-software / prescient.el

☄️ Simple but effective sorting and filtering for Emacs.
MIT License
603 stars 25 forks source link

corfu-prescient-mode doesn't add inserted candidates to prescient--history #135

Closed ssl19 closed 1 year ago

ssl19 commented 1 year ago

Tested with emacs -Q with those settings

(setq corfu-auto t)
(setq corfu-auto-prefix 0)
(corfu-mode +1)
(corfu-prescient-mode +1)

Currently, corfu-prescient--remember doesn't add corfu-insert candidate to prescient--history. It might be related with this line: https://github.com/radian-software/prescient.el/blob/50b7b85d866106ff624a2a5f9c2d129d02480781/vertico-prescient.el#L181

After I use this hack:

(advice-add #'corfu-insert :before #'corfu-prescient--remember)

corfu-prescient--remember seems to work normally.