emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/cape 9bd7bed258 029/146: cape-company-capf: Call the ba


From: ELPA Syncer
Subject: [elpa] externals/cape 9bd7bed258 029/146: cape-company-capf: Call the backend later in the completion process
Date: Sun, 9 Jan 2022 20:57:40 -0500 (EST)

branch: externals/cape
commit 9bd7bed258a6ecd4f034514131a64c09a2d535ce
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    cape-company-capf: Call the backend later in the completion process
---
 cape.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cape.el b/cape.el
index 51904b5a69..8aa608dbab 100644
--- a/cape.el
+++ b/cape.el
@@ -575,10 +575,10 @@ This feature is experimental."
                 ;; remembered result the next time the capf is called.
                 (let* ((no-cache (cape--company-call backend 'no-cache input))
                        (dups (if (cape--company-call backend 'duplicates) 
#'delete-dups #'identity))
-                       (candidates (funcall dups (cape--company-call backend 
'candidates input)))
                        (metadata `(metadata (category . ,backend)))
                        (beg (copy-marker (- (point) (length input))))
-                       (end (copy-marker (point) t)))
+                       (end (copy-marker (point) t))
+                       (candidates 'init))
                   (when (cape--company-call backend 'sorted)
                     (nconc metadata '((display-sort-function . identity)
                                       (cycle-sort-function . identity))))
@@ -586,11 +586,11 @@ This feature is experimental."
                         (lambda (str pred action)
                           (if (eq action 'metadata)
                               metadata
-                            (when no-cache
+                            (when (or (eq candidates 'init) no-cache)
                               ;; Use current input string as prefix (before 
spaces)
                               (let ((new-input (replace-regexp-in-string
                                                 "\\s-.*" "" 
(buffer-substring-no-properties beg end))))
-                                (unless (equal new-input input)
+                                (unless (or (eq candidates 'init) (equal 
new-input input))
                                   (setq input new-input
                                         candidates (funcall dups 
(cape--company-call backend 'candidates input))))))
                             (complete-with-action action candidates str pred)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]