From 724e6dda0741ce0ed3581691c46b348e837e937d Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 11 Feb 2016 15:20:17 +0200 Subject: [PATCH] Delete the cache when async completion aborts Fixes #467 --- company.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/company.el b/company.el index e3fd22c46..51aad7be4 100644 --- a/company.el +++ b/company.el @@ -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. -- 2.39.2