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

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

[elpa] externals/company 426e1830ff 06/30: company--unique-match-p: Also


From: ELPA Syncer
Subject: [elpa] externals/company 426e1830ff 06/30: company--unique-match-p: Also include suffix
Date: Sat, 13 Jul 2024 00:57:50 -0400 (EDT)

branch: externals/company
commit 426e1830ff73f23c36aa73b03277f01e64781881
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    company--unique-match-p: Also include suffix
---
 company.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/company.el b/company.el
index 8a4f6430ef..c2d276c2b8 100644
--- a/company.el
+++ b/company.el
@@ -1635,11 +1635,11 @@ update if FORCE-UPDATE."
     ;; Only now apply the predicate and transformers.
     (company--postprocess-candidates candidates)))
 
-(defun company--unique-match-p (candidates prefix ignore-case)
+(defun company--unique-match-p (candidates prefix suffix ignore-case)
   (and candidates
        (not (cdr candidates))
        (eq t (compare-strings (car candidates) nil nil
-                              prefix nil nil ignore-case))
+                              (concat prefix suffix) nil nil ignore-case))
        (not (eq (company-call-backend 'kind (car candidates))
                 'snippet))))
 
@@ -2269,7 +2269,7 @@ For more details see `company-insertion-on-trigger' and
      ((eq c 'new-input) ; Keep the old completions, company-point, prefix.
       t)
      ((and company-abort-on-unique-match
-           (company--unique-match-p c new-prefix ignore-case))
+           (company--unique-match-p c new-prefix new-suffix ignore-case))
       ;; Handle it like completion was aborted, to differentiate from user
       ;; calling one of Company's commands to insert the candidate,
       ;; not to trigger template expansion, etc.
@@ -2326,7 +2326,7 @@ For more details see `company-insertion-on-trigger' and
               (when company--manual-action
                 (message "No completion found")))
              ((and company-abort-on-unique-match
-                   (company--unique-match-p c company-prefix ignore-case)
+                   (company--unique-match-p c company-prefix company-suffix 
ignore-case)
                    (if company--manual-action
                        ;; If `company-manual-begin' was called, the user
                        ;; really wants something to happen.  Otherwise...



reply via email to

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