[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bb737d8 20/40: Determine exit-function's status using comp
From: |
Dmitry Gutov |
Subject: |
[elpa] master bb737d8 20/40: Determine exit-function's status using completion-boundaries |
Date: |
Thu, 2 Jan 2020 18:57:02 -0500 (EST) |
branch: master
commit bb737d8f89bac781771849db33b1832fa34cc4ca
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Determine exit-function's status using completion-boundaries
Closes #935
---
NEWS.md | 2 ++
company-capf.el | 12 +++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 7c01c1f..135c9e6 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,8 @@
## Next
+* `company-capf`'s `:exit-function` handling has been improved
+ ([#935](https://github.com/company-mode/company-mode/issues/935)).
* New user option `company-clang-use-compile-flags-txt`
([#933](https://github.com/company-mode/company-mode/issues/933)).
* Support for completion style specific sorting (Emacs 27 feature).
diff --git a/company-capf.el b/company-capf.el
index 5b7a1f3..cb30a80 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -188,18 +188,20 @@ so we can't just use the preceding variable instead.")
(defun company--capf-post-completion (arg)
(let* ((res company-capf--current-completion-data)
(exit-function (plist-get (nthcdr 4 res) :exit-function))
- (table (nth 3 res))
- (pred (plist-get (nthcdr 4 res) :predicate)))
+ (table (nth 3 res)))
(if exit-function
- ;; Follow the example of `completion--done'.
+ ;; We can more or less know when the user is done with completion,
+ ;; so we do something different than `completion--done'.
(funcall exit-function arg
;; FIXME: Should probably use an additional heuristic:
;; completion-at-point doesn't know when the user picked a
;; particular candidate explicitly (it only checks whether
;; further completions exist). Whereas company user can press
;; RET (or use implicit completion with company-tng).
- (if (eq (try-completion arg table pred) t)
- 'finished 'sole)))))
+ (if (= (car (completion-boundaries arg table nil ""))
+ (length arg))
+ 'sole
+ 'finished)))))
(provide 'company-capf)
- [elpa] master 856c66a 32/40: company-gtags--annotation: Use regexp-quote, (continued)
- [elpa] master 856c66a 32/40: company-gtags--annotation: Use regexp-quote, Dmitry Gutov, 2020/01/02
- [elpa] master c046847 33/40: Add a NEWS entry, Dmitry Gutov, 2020/01/02
- [elpa] master f3e0290 14/40: Merge branch 'master' of github.com:company-mode/company-mode, Dmitry Gutov, 2020/01/02
- [elpa] master b800fbd 23/40: company-enable-overriding-keymap: Make a defun, Dmitry Gutov, 2020/01/02
- [elpa] master 7fc6ad9 34/40: Merge pull request #941 from amosbird/master, Dmitry Gutov, 2020/01/02
- [elpa] master 0760e48 37/40: Move the entry to the proper position, Dmitry Gutov, 2020/01/02
- [elpa] master dbb4c74 35/40: Merge branch 'master' of github.com:company-mode/company-mode, Dmitry Gutov, 2020/01/02
- [elpa] master 1b00f8c 38/40: Update copyright notice, Dmitry Gutov, 2020/01/02
- [elpa] master ed14c67 40/40: Merge commit '3c11c30c9ab41d8a9c88560071c48fbcdcbcba5d' from company, Dmitry Gutov, 2020/01/02
- [elpa] master 3c11c30 39/40: Bump the version, Dmitry Gutov, 2020/01/02
- [elpa] master bb737d8 20/40: Determine exit-function's status using completion-boundaries,
Dmitry Gutov <=
- [elpa] master 74bb693 21/40: Call Clang from the directory containing compile_flags.txt, Dmitry Gutov, 2020/01/02
- [elpa] master 7f3ae90 19/40: Add option company-clang-use-compile-flags-txt, Dmitry Gutov, 2020/01/02
- [elpa] master da4da70 36/40: Edit NEWS, Dmitry Gutov, 2020/01/02