[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1f836b6 37/66: Merge pull request #810 from joaotavora/mas
From: |
Dmitry Gutov |
Subject: |
[elpa] master 1f836b6 37/66: Merge pull request #810 from joaotavora/master |
Date: |
Mon, 5 Nov 2018 18:19:18 -0500 (EST) |
branch: master
commit 1f836b6b16d313bddef2cccebf49f42d36c58e28
Merge: 24bbc85 d0fab46
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #810 from joaotavora/master
Properly fix #809
---
company-capf.el | 2 +-
test/capf-tests.el | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/company-capf.el b/company-capf.el
index 409687b..343edca 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -133,7 +133,7 @@
((and match-start (not has-face-p))
(push (cons match-start pos) chunks)
(setq match-start nil))))
- (if chunks (nreverse chunks) (cons 0 (length arg)))))))
+ (nreverse chunks)))))
(`duplicates t)
(`no-cache t) ;Not much can be done here, as long as we handle
;non-prefix matches.
diff --git a/test/capf-tests.el b/test/capf-tests.el
index b70131c..c8d4202 100644
--- a/test/capf-tests.el
+++ b/test/capf-tests.el
@@ -55,6 +55,30 @@
(should company-candidates)
(should (member "with-current-buffer" company-candidates))))
+(ert-deftest company-basic-capf-highlighting ()
+ "Test basic `company-capf' support, with basic prefix completion."
+ (company-capf-with-buffer
+ "(with|)"
+ (company-mode)
+ (company-complete)
+ (should company-candidates)
+ (let* ((cand (car (member "with-current-buffer" company-candidates)))
+ (render
+ (and cand
+ (company-fill-propertize cand nil (length cand) nil nil
nil))))
+ ;; remove `font-lock-face' and `mouse-face' text properties that aren't
+ ;; relevant to our test
+ (remove-list-of-text-properties
+ 0 (length cand) '(font-lock-face mouse-face) render)
+ (should
+ (ert-equal-including-properties
+ render
+ #("with-current-buffer"
+ 0 4 (face (company-tooltip-common company-tooltip)) ; "with"
+ 4 19 (face (company-tooltip))))))))
+
+
+
;; Re. "perfect" highlighting of the non-prefix in company-capf matches, it is
;; only working-out-of-the box (i.e. without the `:company-match' meta) in
;; recent Emacsen containing the following commit. The two tests that follow
- [elpa] master c95a6b4 65/66: Release 0.9.7, (continued)
- [elpa] master c95a6b4 65/66: Release 0.9.7, Dmitry Gutov, 2018/11/05
- [elpa] master 1e22493 66/66: Merge commit 'c95a6b41d621de4253b77e512aa61fc0e75acddc' from company, Dmitry Gutov, 2018/11/05
- [elpa] master ffba418 26/66: Merge pull request #802 from wyuenho/update-keywords, Dmitry Gutov, 2018/11/05
- [elpa] master 5ab7f42 64/66: Merge pull request #838 from bet4it/restore-point, Dmitry Gutov, 2018/11/05
- [elpa] master f31d284 33/66: Mention #798 in NEWS.md, Dmitry Gutov, 2018/11/05
- [elpa] master d0fab46 36/66: Properly fix #809, Dmitry Gutov, 2018/11/05
- [elpa] master 7e20ee4 43/66: update go-mode's keywords sort, Dmitry Gutov, 2018/11/05
- [elpa] master 2bcaa2e 55/66: add some refs, Dmitry Gutov, 2018/11/05
- [elpa] master afbaad1 62/66: company-ispell-available: Better error message, Dmitry Gutov, 2018/11/05
- [elpa] master 24bbc85 35/66: Fix #809 by looking up `face' as well, Dmitry Gutov, 2018/11/05
- [elpa] master 1f836b6 37/66: Merge pull request #810 from joaotavora/master,
Dmitry Gutov <=
- [elpa] master 3162aa2 47/66: Update company-keywords.el, Dmitry Gutov, 2018/11/05
- [elpa] master b423ba4 48/66: Merge pull request #819 from chunzhouyu/master, Dmitry Gutov, 2018/11/05
- [elpa] master a163e94 49/66: Improve comment, Dmitry Gutov, 2018/11/05
- [elpa] master 44ed412 54/66: resort go-mode'e keywords, Dmitry Gutov, 2018/11/05