diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-10-16 22:01:35 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-10-16 22:01:35 +0200 |
| commit | 0321c162b1ec75ed1cb3c1d0c3ebf90d8bf3188d (patch) | |
| tree | 960167b046e5ee78cacab5051b7e126591a37a0e | |
| parent | f97e64e87071c880f4a92ac73bed667e89e4e580 (diff) | |
cache clearingcache-clear
| -rw-r--r-- | cape.el | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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))) |
