]> code.delx.au - gnu-emacs-elpa/commitdiff
company--begin-new: Call `company-cancel' in the unique case
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 17 Jun 2015 19:58:23 +0000 (22:58 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 17 Jun 2015 19:58:23 +0000 (22:58 +0300)
To fix a problem reported in
http://lists.gnu.org/archive/html/help-gnu-emacs/2015-06/msg00273.html

company.el

index 0aa034286d6c72a53038ceb0d446c9421c23e80b..ed5e14c2fb9e94c58d44282e305c17738e28a81e 100644 (file)
@@ -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)