[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 829b40f 46/66: company--continue-failed: Don't burp on `st
From: |
Dmitry Gutov |
Subject: |
[elpa] master 829b40f 46/66: company--continue-failed: Don't burp on `stop' |
Date: |
Tue, 13 Jan 2015 02:45:00 +0000 |
branch: master
commit 829b40f1a4bad7e8ab3f89f0ceb84d5edc0b4823
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
company--continue-failed: Don't burp on `stop'
#273
---
company.el | 1 +
test/core-tests.el | 24 ++++++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/company.el b/company.el
index c53d7ae..e6bebbf 100644
--- a/company.el
+++ b/company.el
@@ -1366,6 +1366,7 @@ from the rest of the back-ends in the group, if any, will
be left at the end."
((and (or (not (company-require-match-p))
;; Don't require match if the new prefix
;; doesn't continue the old one, and the latter was a match.
+ (not (stringp new-prefix))
(<= (length new-prefix) (length company-prefix)))
(member company-prefix company-candidates))
;; Last input was a success,
diff --git a/test/core-tests.el b/test/core-tests.el
index 0ff691e..90ce69c 100644
--- a/test/core-tests.el
+++ b/test/core-tests.el
@@ -207,12 +207,12 @@
(should (eq nil company-candidates-length))
(should (eq 4 (point))))))
-(ert-deftest company-dont-require-match-if-old-prefix-ended-and-was-a-match ()
+(ert-deftest company-dont-require-match-if-was-a-match-and-old-prefix-ended ()
(with-temp-buffer
(insert "ab")
(company-mode)
(let (company-frontends
- (company-require-match 'company-explicit-action-p)
+ (company-require-match t)
(company-backends
(list (lambda (command &optional _)
(cl-case command
@@ -230,6 +230,26 @@
(should (null company-candidates-length))
(should (eq 4 (point))))))
+(ert-deftest company-dont-require-match-if-was-a-match-and-new-prefix-is-stop
()
+ (with-temp-buffer
+ (company-mode)
+ (insert "c")
+ (let (company-frontends
+ (company-require-match t)
+ (company-backends
+ (list (lambda (command &optional _)
+ (cl-case command
+ (prefix (if (> (point) 2)
+ 'stop
+ (buffer-substring (point-min) (point))))
+ (candidates '("a" "b" "c")))))))
+ (let (this-command)
+ (company-complete))
+ (should (eq 3 company-candidates-length))
+ (let ((last-command-event ?e))
+ (company-call 'self-insert-command 1))
+ (should (not company-candidates)))))
+
(ert-deftest company-should-complete-whitelist ()
(with-temp-buffer
(insert "ab")
- [elpa] master ed97b73 34/66: company--insert-candidate: Don't change buffer modification status unnecessarily, (continued)
- [elpa] master ed97b73 34/66: company--insert-candidate: Don't change buffer modification status unnecessarily, Dmitry Gutov, 2015/01/12
- [elpa] master 6d023fd 36/66: Add NEWS entry, Dmitry Gutov, 2015/01/12
- [elpa] master 8d4ba7a 38/66: company-preview-show-at-point: Handle the pseudo-tooltip-overlay, Dmitry Gutov, 2015/01/12
- [elpa] master bd5e453 39/66: #267 follow-up fixes, Dmitry Gutov, 2015/01/12
- [elpa] master 7ac956a 37/66: Fix typo, Dmitry Gutov, 2015/01/12
- [elpa] master ccecb37 32/66: Merge pull request #252 from markus1189/bbdb-customize-group, Dmitry Gutov, 2015/01/12
- [elpa] master 6ff5ed3 40/66: Clear out unused variable warnings, Dmitry Gutov, 2015/01/12
- [elpa] master 8b587c0 43/66: Add .elpaignore, Dmitry Gutov, 2015/01/12
- [elpa] master eef07a5 44/66: Support template functions in company-clang annotations, Dmitry Gutov, 2015/01/12
- [elpa] master 80620a1 45/66: Remove ineffective change from c6e9fbad312fc62876d40032a84a94439a055d05, Dmitry Gutov, 2015/01/12
- [elpa] master 829b40f 46/66: company--continue-failed: Don't burp on `stop',
Dmitry Gutov <=
- [elpa] master 0a172c5 47/66: company-search-map: Support keypad numbers, Dmitry Gutov, 2015/01/12
- [elpa] master ff9bafc 41/66: Don't idle-begin when company-candidates is non-nil, Dmitry Gutov, 2015/01/12
- [elpa] master 9335f7b 48/66: company-search-delete-char: New command, Dmitry Gutov, 2015/01/12
- [elpa] master 048a9c4 50/66: company-search-old-map: Remove, unused, Dmitry Gutov, 2015/01/12
- [elpa] master a850cdb 51/66: Privatize some search functions (and a var), Dmitry Gutov, 2015/01/12
- [elpa] master 7b312dd 52/66: Introduce `company-search-toggle-filtering', Dmitry Gutov, 2015/01/12
- [elpa] master 0d2757c 56/66: company-search-map: Add M-n and M-p bindings, Dmitry Gutov, 2015/01/12
- [elpa] master f5942e9 55/66: company-fill-propertize: Don't highlight match beg till common part, Dmitry Gutov, 2015/01/12
- [elpa] master aa7c1ca 57/66: Simplify NEWS entry, Dmitry Gutov, 2015/01/12
- [elpa] master eb1f0db 58/66: Fixup a test, Dmitry Gutov, 2015/01/12