[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company a79bfd7cea 19/24: Fix multi-backend completion
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company a79bfd7cea 19/24: Fix multi-backend completion right after a trigger char |
Date: |
Tue, 27 Aug 2024 00:57:44 -0400 (EDT) |
branch: externals/company
commit a79bfd7ceafa4b1ba2a581dafd0d8bdfd484f2fe
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
Fix multi-backend completion right after a trigger char
---
company.el | 6 ++++--
test/core-tests.el | 12 ++++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/company.el b/company.el
index 364652f455..3138665058 100644
--- a/company.el
+++ b/company.el
@@ -1419,8 +1419,10 @@ be recomputed when this value changes."
(or (not backends-after-with)
(unless (memq backend backends-after-with)
(setq backends-after-with nil)))
- (when (> (length (company--prefix-str entity))
- (length prefix))
+ (when (or
+ (null prefix)
+ (> (length (company--prefix-str entity))
+ (length prefix)))
(setq prefix (company--prefix-str entity)))
(when (> (length (company--suffix-str entity))
(length suffix))
diff --git a/test/core-tests.el b/test/core-tests.el
index d27be8a16d..0f8230f9ee 100644
--- a/test/core-tests.el
+++ b/test/core-tests.el
@@ -128,6 +128,18 @@
(company-call-backend 'set-min-prefix 1)
(should (equal (company-call-backend 'candidates "z") '("a" "b" "c"
"d")))))
+(ert-deftest company-multi-backend-with-empty-prefixes ()
+ (let ((company-backend
+ (list (lambda (command &optional _ &rest _r)
+ (cl-case command
+ (prefix "")
+ (candidates '("a" "b"))))
+ (lambda (command &optional _ &rest _r)
+ (cl-case command
+ (prefix "")
+ (candidates '("c" "d")))))))
+ (should (equal (company-call-backend 'prefix) '("" nil 0)))))
+
(ert-deftest company-multi-backend-dispatches-separate-prefix-to-backends ()
(let ((company-backend
(list (lambda (command &optional arg &rest _r)
- [elpa] externals/company updated (1321e285a5 -> e1d331a64e), ELPA Syncer, 2024/08/27
- [elpa] externals/company 6d32df97db 05/24: Update a test definition, ELPA Syncer, 2024/08/27
- [elpa] externals/company 587a2ba3ce 03/24: Better text, ELPA Syncer, 2024/08/27
- [elpa] externals/company 09e52cb8ad 09/24: Support combining `expand-common` across grouped backends, ELPA Syncer, 2024/08/27
- [elpa] externals/company f907fb3468 02/24: Fix test failure, ELPA Syncer, 2024/08/27
- [elpa] externals/company a427c330ca 04/24: Support different prefixes inside a backend group, ELPA Syncer, 2024/08/27
- [elpa] externals/company f38e649244 11/24: Add expand-common support in company-dabbrev-code and company-etags, ELPA Syncer, 2024/08/27
- [elpa] externals/company d8f18dcf06 12/24: company--expand-common: Don't rely on company-common, ELPA Syncer, 2024/08/27
- [elpa] externals/company de19f899d1 15/24: Add possible return value `no-match` to `expand-common`, ELPA Syncer, 2024/08/27
- [elpa] externals/company a79bfd7cea 19/24: Fix multi-backend completion right after a trigger char,
ELPA Syncer <=
- [elpa] externals/company 39a4aee31c 16/24: Delete piece of code unused since 36aae5183, ELPA Syncer, 2024/08/27
- [elpa] externals/company 225d27d392 17/24: Update one test (1) and fix another (2), ELPA Syncer, 2024/08/27
- [elpa] externals/company 64a3787db7 14/24: Copy edit, ELPA Syncer, 2024/08/27
- [elpa] externals/company df4f6e9ea3 21/24: company--common-or-matches: Synchronize with 'match' more, ELPA Syncer, 2024/08/27
- [elpa] externals/company 8a4872a81b 23/24: company-capf--current-boundaries only for matching completions, ELPA Syncer, 2024/08/27
- [elpa] externals/company e1d331a64e 24/24: [ci skip] Remove parens, ELPA Syncer, 2024/08/27
- [elpa] externals/company 36aae5183a 13/24: company--multi-expand-common: Simplify the compatibility check, ELPA Syncer, 2024/08/27
- [elpa] externals/company 71fad0b38a 06/24: Delete a no-op line, ELPA Syncer, 2024/08/27
- [elpa] externals/company 4ba6dcb874 22/24: Merge pull request #1488 from company-mode/expand-common, ELPA Syncer, 2024/08/27
- [elpa] externals/company 82e7f81dcb 07/24: Support complete-common in backends with boundaries and no `expand-common`, ELPA Syncer, 2024/08/27