summaryrefslogtreecommitdiff
path: root/cape.el
diff options
context:
space:
mode:
Diffstat (limited to 'cape.el')
-rw-r--r--cape.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/cape.el b/cape.el
index e666bd8..ac8f719 100644
--- a/cape.el
+++ b/cape.el
@@ -782,7 +782,7 @@ changed. The function `cape-company-to-capf' is experimental."
(dups (cape--company-call backend 'duplicates))
(valid (if (cape--company-call backend 'no-cache initial-input)
#'equal (or valid #'string-prefix-p)))
- candidates)
+ reset candidates)
(list beg end
(funcall
(if (cape--company-call backend 'ignore-case)
@@ -792,6 +792,13 @@ changed. The function `cape-company-to-capf' is experimental."
(cape--dynamic-table
beg end
(lambda (input)
+ ;; HACK: Clear caches used internally by Company backends.
+ ;; It would be better if backends support a `cache-clear'
+ ;; action instead such that we wouldn't have to bypass the
+ ;; backend and access Company directly.
+ (when (and (not reset) (boundp 'company--cache))
+ (clrhash company--cache)
+ (setq reset t))
(setq candidates (cape--company-call backend 'candidates input))
(when dups (setq candidates (delete-dups candidates)))
(cons (apply-partially valid input) candidates)))