branch: master
commit ac1dc5bcdfac0b4ae64122690ae22c755d73e790
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
counsel.el (counsel-company): New command
Re #331
---
counsel.el | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/counsel.el b/counsel.el
index 6eb5c5f..edab7c6 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2089,6 +2089,20 @@ And insert it into the minibuffer. Useful during
:action #'counsel-linux-app-action-default
:caller 'counsel-linux-app))
+;;;###autoload
+(defun counsel-company ()
+ "Complete using `company-candidates'."
+ (interactive)
+ (unless company-candidates
+ (company-complete))
+ (when company-point
+ (company-complete-common)
+ (when (looking-back company-common (line-beginning-position))
+ (setq ivy-completion-beg (match-beginning 0))
+ (setq ivy-completion-end (match-end 0)))
+ (ivy-read "company cand: " company-candidates
+ :action #'ivy-completion-in-region-action)))
+
;;** `counsel-mode'
(defvar counsel-mode-map
(let ((map (make-sparse-keymap)))