From 80a3c9bf621aae93148126decde0319cef48532c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 5 Jul 2018 21:45:44 +0200 Subject: [PATCH] Fix company-box not showing lone candidates Revert this once sebastiencz/company-box#40 is merged. --- modules/completion/company/config.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/completion/company/config.el b/modules/completion/company/config.el index 104305c5b..0e3bc00c1 100644 --- a/modules/completion/company/config.el +++ b/modules/completion/company/config.el @@ -67,7 +67,19 @@ (22 . (all-the-icons-material "streetview" :height 0.8 :face 'all-the-icons-red)) ; struct (23 . (all-the-icons-material "event" :height 0.8 :face 'all-the-icons-red)) ; event (24 . (all-the-icons-material "control_point" :height 0.8 :face 'all-the-icons-red)) ; operator - (25 . (all-the-icons-material "class" :height 0.8 :face 'all-the-icons-red))))) + (25 . (all-the-icons-material "class" :height 0.8 :face 'all-the-icons-red)))) + + ;; Until sebastiencs/company-box#40 is merged + (defun +company*box-frontend-even-if-single (command) + (cond ((eq command 'hide) + (company-box-hide)) + ((equal company-candidates-length 0) + (company-box-hide)) + ((eq command 'update) + (company-box-show)) + ((eq command 'post-command) + (company-box--post-command)))) + (advice-add #'company-box-frontend :override #'+company*box-frontend-even-if-single)) (def-package! company-dict