branch: master commit 6846466bbbc912673682e8a5ac6f91c51452ae51 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: Dmitry Gutov <dgu...@yandex.ru>
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)