]> code.delx.au - gnu-emacs-elpa/blobdiff - company.el
Delete the cache when async completion aborts
[gnu-emacs-elpa] / 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-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.