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

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

[elpa] master 6846466 01/66: company-capf: Distinguish between `finished


From: Dmitry Gutov
Subject: [elpa] master 6846466 01/66: company-capf: Distinguish between `finished' and `exact' in post-completion
Date: Tue, 13 Jan 2015 02:44:41 +0000

branch: master
commit 6846466bbbc912673682e8a5ac6f91c51452ae51
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    company-capf: Distinguish between `finished' and `exact' in post-completion
    
    Fixes #217
---
 company-capf.el |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/company-capf.el b/company-capf.el
index b630025..1a0e9ec 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -138,9 +138,14 @@
     (`init nil)      ;Don't bother: plenty of other ways to initialize the 
code.
     (`post-completion
      (let* ((res (company--capf-data))
-            (exit-function (plist-get (nthcdr 4 res) :exit-function)))
+            (exit-function (plist-get (nthcdr 4 res) :exit-function))
+            (table (nth 3 res))
+            (pred (plist-get (nthcdr 4 res) :predicate)))
        (if exit-function
-           (funcall exit-function arg 'finished))))
+           ;; Follow the example of `completion--done'.
+           (funcall exit-function arg
+                    (if (eq (try-completion arg table pred) t)
+                        'finished 'exact)))))
     ))
 
 (provide 'company-capf)



reply via email to

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