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:
parent
1983c4c5d9
commit
cc6b0ee274
2 changed files with 8 additions and 5 deletions
|
@ -10,12 +10,13 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +corfu-move-to-minibuffer ()
|
(defun +corfu-move-to-minibuffer ()
|
||||||
;; Taken from corfu's README.
|
;; Adapted from Corfu's README.
|
||||||
;; TODO: extend this to other completion front-ends.
|
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((completion-extra-properties corfu--extra)
|
(pcase completion-in-region--data
|
||||||
(completion-cycle-threshold completion-cycling))
|
(`(,beg ,end ,table ,pred . ,extras)
|
||||||
(apply #'consult-completion-in-region completion-in-region--data)))
|
(let ((completion-extra-properties extras)
|
||||||
|
completion-cycle-threshold completion-cycling)
|
||||||
|
(funcall (default-value 'completion-in-region-function) beg end table pred)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +corfu-smart-sep-toggle-escape ()
|
(defun +corfu-smart-sep-toggle-escape ()
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
tab-always-indent (if (modulep! +tng) 'complete tab-always-indent))
|
tab-always-indent (if (modulep! +tng) 'complete tab-always-indent))
|
||||||
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
|
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
|
||||||
|
|
||||||
|
(add-to-list 'corfu-continue-commands #'+corfu-move-to-minibuffer)
|
||||||
|
|
||||||
(add-hook! 'minibuffer-setup-hook
|
(add-hook! 'minibuffer-setup-hook
|
||||||
(defun +corfu-enable-in-minibuffer ()
|
(defun +corfu-enable-in-minibuffer ()
|
||||||
"Enable Corfu in the minibuffer if `completion-at-point' is bound."
|
"Enable Corfu in the minibuffer if `completion-at-point' is bound."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue