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

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

[elpa] externals/capf-autosuggest 6432d5f 09/63: Avoid error if all-comp


From: ELPA Syncer
Subject: [elpa] externals/capf-autosuggest 6432d5f 09/63: Avoid error if all-completions returns invalid strings
Date: Wed, 27 Oct 2021 14:57:54 -0400 (EDT)

branch: externals/capf-autosuggest
commit 6432d5f23b4bc14d8dcb8b27de3b56d080d7822a
Author: jakanakaevangeli <jakanakaevangeli@chiru.no>
Commit: jakanakaevangeli <jakanakaevangeli@chiru.no>

    Avoid error if all-completions returns invalid strings
---
 capf-autosuggest.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/capf-autosuggest.el b/capf-autosuggest.el
index c757fe3..086358a 100644
--- a/capf-autosuggest.el
+++ b/capf-autosuggest.el
@@ -121,6 +121,9 @@ point forward."
                    ;; as we only use the string without the prefix for the
                    ;; overlay.
                    (all-completions string table pred)))
+                ;; `all-completions' may return strings that don't strictly
+                ;; match on our prefix. Ignore them.
+                ((string-prefix-p (substring string base) (car completions)))
                 (str (substring (car completions) (- end beg base)))
                 ((/= 0 (length str))))
              (setq capf-autosuggest--region (cons beg end)



reply via email to

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