feat(corfu): general move-to-minibuffer impl

We relied directly on consult for this, meaning it needed the vertico
module. Now, it should defer to the user's choice, including helm, ivy
and ido.
This commit is contained in:
Luigi Sartor Piucco 2024-02-04 17:17:13 -03:00
parent 1983c4c5d9
commit cc6b0ee274
No known key found for this signature in database
GPG key ID: 6FF1A01853A47A66
2 changed files with 8 additions and 5 deletions

View file

@ -10,12 +10,13 @@
;;;###autoload
(defun +corfu-move-to-minibuffer ()
;; Taken from corfu's README.
;; TODO: extend this to other completion front-ends.
;; Adapted from Corfu's README.
(interactive)
(let ((completion-extra-properties corfu--extra)
(completion-cycle-threshold completion-cycling))
(apply #'consult-completion-in-region completion-in-region--data)))
(pcase completion-in-region--data
(`(,beg ,end ,table ,pred . ,extras)
(let ((completion-extra-properties extras)
completion-cycle-threshold completion-cycling)
(funcall (default-value 'completion-in-region-function) beg end table pred)))))
;;;###autoload
(defun +corfu-smart-sep-toggle-escape ()