[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d44f2ad 2/2: Merge commit '3e70e12bd942bbd0acac4963b5caca6
From: |
Dmitry Gutov |
Subject: |
[elpa] master d44f2ad 2/2: Merge commit '3e70e12bd942bbd0acac4963b5caca63756ad784' from company |
Date: |
Wed, 04 Feb 2015 16:35:47 +0000 |
branch: master
commit d44f2ad44bff2fde36e58bab2f0f515d4dd6782d
Merge: ca5d92e 3e70e12
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Merge commit '3e70e12bd942bbd0acac4963b5caca63756ad784' from company
---
packages/company/company.el | 11 +++++++----
packages/company/test/frontends-tests.el | 20 ++++++++++++++++++++
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/packages/company/company.el b/packages/company/company.el
index 86d93c2..af4671e 100644
--- a/packages/company/company.el
+++ b/packages/company/company.el
@@ -5,7 +5,7 @@
;; Author: Nikolaj Schumacher
;; Maintainer: Dmitry Gutov <address@hidden>
;; URL: http://company-mode.github.io/
-;; Version: 0.8.10
+;; Version: 0.8.11
;; Keywords: abbrev, convenience, matching
;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
@@ -2231,9 +2231,12 @@ If SHOW-VERSION is non-nil, show the version in the echo
area."
(string-match (regexp-quote company-search-string) value
(length company-prefix)))
(let ((beg (+ margin (match-beginning 0)))
- (end (+ margin (match-end 0))))
- (add-text-properties beg end '(face company-tooltip-search)
- line))
+ (end (+ margin (match-end 0)))
+ (width (- width (length right))))
+ (when (< beg width)
+ (add-text-properties beg (min end width)
+ '(face company-tooltip-search)
+ line)))
(add-text-properties 0 width '(face company-tooltip-selection
mouse-face company-tooltip-selection)
line)
diff --git a/packages/company/test/frontends-tests.el
b/packages/company/test/frontends-tests.el
index 35c94c9..613856e 100644
--- a/packages/company/test/frontends-tests.el
+++ b/packages/company/test/frontends-tests.el
@@ -245,6 +245,26 @@
" MIRAI発売2カ月 ")
(company--create-lines 0 999)))))
+(ert-deftest company-fill-propertize-truncates-search-highlight ()
+ (let ((company-search-string "foo")
+ (company-backend #'ignore)
+ (company-prefix ""))
+ (should (equal-including-properties
+ (company-fill-propertize "barfoo" nil 6 t nil nil)
+ #("barfoo"
+ 0 3 (face company-tooltip mouse-face company-tooltip-mouse)
+ 3 6 (face company-tooltip-search mouse-face
company-tooltip-mouse))))
+ (should (equal-including-properties
+ (company-fill-propertize "barfoo" nil 5 t "" " ")
+ #("barfo "
+ 0 3 (face company-tooltip mouse-face company-tooltip-mouse)
+ 3 5 (face company-tooltip-search mouse-face
company-tooltip-mouse)
+ 5 6 (face company-tooltip mouse-face company-tooltip-mouse))))
+ (should (equal-including-properties
+ (company-fill-propertize "barfoo" nil 3 t " " " ")
+ #(" bar "
+ 0 5 (face company-tooltip mouse-face company-tooltip-mouse))))))
+
(ert-deftest company-column-with-composition ()
:tags '(interactive)
(with-temp-buffer
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master d44f2ad 2/2: Merge commit '3e70e12bd942bbd0acac4963b5caca63756ad784' from company,
Dmitry Gutov <=