]> code.delx.au - gnu-emacs-elpa/commitdiff
Delete the cache when async completion aborts
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 11 Feb 2016 13:20:17 +0000 (15:20 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 11 Feb 2016 13:20:17 +0000 (15:20 +0200)
Fixes #467

company.el

index e3fd22c4661adec46c81ed494954ed73cec3657a..51aad7be4351cf0de5f2e5962f202c112e0b10a1 100644 (file)
@@ -1186,7 +1186,11 @@ can retrieve meta-data for them."
                    company-candidates-cache
                    (list (cons prefix
                                (company--preprocess-candidates candidates))))
                    company-candidates-cache
                    (list (cons prefix
                                (company--preprocess-candidates candidates))))
-             (company-idle-begin buf win tick pt)))))
+             (unwind-protect
+                 (company-idle-begin buf win tick pt)
+               (unless company-candidates
+                 (setq company-backend nil
+                       company-candidates-cache nil)))))))
       ;; FIXME: Relying on the fact that the callers
       ;; will interpret nil as "do nothing" is shaky.
       ;; A throw-catch would be one possible improvement.
       ;; FIXME: Relying on the fact that the callers
       ;; will interpret nil as "do nothing" is shaky.
       ;; A throw-catch would be one possible improvement.