From: Dmitry Gutov Date: Wed, 17 Jun 2015 19:58:23 +0000 (+0300) Subject: company--begin-new: Call `company-cancel' in the unique case X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/d2ff1dcb0a9f8343cfe6f66d21527f81db16642f?ds=sidebyside company--begin-new: Call `company-cancel' in the unique case To fix a problem reported in http://lists.gnu.org/archive/html/help-gnu-emacs/2015-06/msg00273.html --- diff --git a/company.el b/company.el index 0aa034286..ed5e14c2f 100644 --- a/company.el +++ b/company.el @@ -1472,10 +1472,13 @@ from the rest of the back-ends in the group, if any, will be left at the end." (setq company-prefix (company--prefix-str prefix) company-backend backend c (company-calculate-candidates company-prefix)) - ;; t means complete/unique. We don't start, so no hooks. (if (not (consp c)) - (when company--manual-action - (message "No completion found")) + (progn + ;; t means complete/unique. + ;; Run the hooks anyway, to e.g. clear the cache. + (company-cancel 'unique) + (when company--manual-action + (message "No completion found"))) (when company--manual-action (setq company--manual-prefix prefix)) (company-update-candidates c)