[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company d8f18dcf06 12/24: company--expand-common: Don't
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company d8f18dcf06 12/24: company--expand-common: Don't rely on company-common |
Date: |
Tue, 27 Aug 2024 00:57:43 -0400 (EDT) |
branch: externals/company
commit d8f18dcf0608b661f1b7b9f3db91460b66370d2d
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
company--expand-common: Don't rely on company-common
---
company.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/company.el b/company.el
index 91377c05c9..0b8d26b658 100644
--- a/company.el
+++ b/company.el
@@ -3067,7 +3067,12 @@ For use in the `select-mouse' frontend action.
`let'-bound.")
(let ((expansion (company-call-backend 'expand-common prefix suffix)))
(unless expansion
;; Backend doesn't implement this, try emulating.
- (let* ((max-len (when (and company-common
+ (let* (;; Assuming that boundaries don't vary between completions here.
+ ;; If they do, the backend should have a custom `expand-common'.
+ (boundaries-prefix (car (company--boundaries)))
+ (trycmp (try-completion boundaries-prefix candidates))
+ (common (if (eq trycmp t) (car candidates) trycmp))
+ (max-len (when (and common
(cl-every (lambda (s) (string-suffix-p suffix
s))
candidates))
(-
@@ -3075,13 +3080,9 @@ For use in the `select-mouse' frontend action.
`let'-bound.")
(mapcar #'length candidates))
(length suffix))))
(common (if max-len
- (substring company-common 0
- (min max-len (length company-common)))
- company-common))
- ;; We're making an assumption that boundaries don't vary
- ;; between completions here. If they do, the backend should
- ;; have a custom implementation for `expand-common'.
- (boundaries-prefix (car (company--boundaries))))
+ (substring common 0
+ (min max-len (length common)))
+ common)))
(setq expansion (cons (if (string-prefix-p boundaries-prefix
common
t)
- [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 <=
- [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, 2024/08/27
- [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