Skip to content

Commit

Permalink
fix(company): completing-read interface on C-S-s
Browse files Browse the repository at this point in the history
C-S-s while company is completing shoudl bring up the results in your
completion framework of choice (ivy, helm, vertico, etc), but failed to
do so for vertico (for any completion backend besides company-capf
perhaps).
  • Loading branch information
hlissner committed Oct 4, 2022
1 parent 57e9965 commit 58fb83c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 15 additions & 0 deletions modules/completion/company/autoload.el
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,18 @@ C-x C-l."
(let ((company-selection-wrap-around t))
(call-interactively #'+company/dabbrev)
(company-select-previous-or-abort)))

;;;###autoload
(defun +company/completing-read ()
"Complete current company candidates in minibuffer.
Uses ivy, helm, vertico, or ido, if available."
(interactive)
(cond ((modulep! :completion ivy)
(call-interactively #'counsel-company))
((modulep! :completion helm)
(call-interactively #'helm-company))
((not company-candidates)
(user-error "No company candidates available"))
((when-let (cand (completing-read "Candidate: " company-candidates))
(company-finish cand)))))
4 changes: 1 addition & 3 deletions modules/config/default/+evil-bindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@
"C-u" #'company-previous-page
"C-d" #'company-next-page
"C-s" #'company-filter-candidates
"C-S-s" (cond ((modulep! :completion vertico) #'completion-at-point)
((modulep! :completion ivy) #'counsel-company)
((modulep! :completion helm) #'helm-company))
"C-S-s" #'+company/completing-read
"C-SPC" #'company-complete-common
"TAB" #'company-complete-common-or-cycle
[tab] #'company-complete-common-or-cycle
Expand Down

0 comments on commit 58fb83c

Please sign in to comment.