[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company bc52a6136e 17/30: Strip the matching suffix in
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company bc52a6136e 17/30: Strip the matching suffix in preview too |
Date: |
Sat, 13 Jul 2024 00:57:51 -0400 (EDT) |
branch: externals/company
commit bc52a6136e5065737c5bd69a6068a066439dd3cd
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
Strip the matching suffix in preview too
#340
---
company.el | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/company.el b/company.el
index 65b3ed84a7..99758ab7e5 100644
--- a/company.el
+++ b/company.el
@@ -4217,6 +4217,7 @@ Delay is determined by `company-tooltip-idle-delay'."
(let* ((boundaries (company--boundaries completion))
(prefix (car boundaries))
+ (suffix (cdr boundaries))
(company-common (and company-common
(string-prefix-p prefix company-common)
company-common))
@@ -4243,6 +4244,11 @@ Delay is determined by `company-tooltip-idle-delay'."
(company-strip-prefix completion prefix)
completion))
+ (setq completion (if (string-suffix-p suffix completion)
+ (substring completion 0 (- (length completion)
+ (length suffix)))
+ completion))
+
(when (string-prefix-p "\n" completion)
(setq completion (concat (propertize " " 'face 'company-preview) "\n"
(substring completion 1))))
@@ -4303,14 +4309,18 @@ Delay is determined by `company-tooltip-idle-delay'."
(company-preview-frontend command)))
(defun company--show-inline-p ()
- (let ((prefix (car (company--boundaries (car company-candidates)))))
+ (let* ((boundaries (company--boundaries (car company-candidates)))
+ (prefix (car boundaries))
+ (suffix (cdr boundaries))
+ (ignore-case (company-call-backend 'ignore-case))
+ (candidate (car company-candidates)))
(and (not (cdr company-candidates))
- (string-empty-p company-suffix)
company-common
(not (eq t (compare-strings prefix nil nil
- (car company-candidates) nil nil
+ candidate nil nil
t)))
- (or (eq (company-call-backend 'ignore-case) 'keep-prefix)
+ (string-suffix-p suffix candidate ignore-case)
+ (or (eq ignore-case 'keep-prefix)
(string-prefix-p prefix company-common)))))
(defun company-tooltip-visible-p ()
- [elpa] externals/company 54b0148ce4 16/30: Fix bytecomp warnings, (continued)
- [elpa] externals/company 54b0148ce4 16/30: Fix bytecomp warnings, ELPA Syncer, 2024/07/13
- [elpa] externals/company d4e01ed948 21/30: #1474 change the reference in NEWS, ELPA Syncer, 2024/07/13
- [elpa] externals/company 31f7ad52e4 30/30: Merge pull request #1474 from company-mode/completion_inside_symbol, ELPA Syncer, 2024/07/13
- [elpa] externals/company a253fa5505 25/30: company-files--prefix: Capture suffix as well, ELPA Syncer, 2024/07/13
- [elpa] externals/company bbe0bc031a 13/30: company--multi-backend-adapter: Support suffix and `adjust-boundaries`, ELPA Syncer, 2024/07/13
- [elpa] externals/company c8a06ff3bf 11/30: Support completion styles in company-etags too, ELPA Syncer, 2024/07/13
- [elpa] externals/company a986091380 20/30: Fix test failures, ELPA Syncer, 2024/07/13
- [elpa] externals/company 0503adea94 22/30: company-dabbrev: Also support completion inside a word, ELPA Syncer, 2024/07/13
- [elpa] externals/company 6f54897015 15/30: Fix remaining failure, ELPA Syncer, 2024/07/13
- [elpa] externals/company c987a27148 24/30: company-files: Use the `adjust-boundaries` action, ELPA Syncer, 2024/07/13
- [elpa] externals/company bc52a6136e 17/30: Strip the matching suffix in preview too,
ELPA Syncer <=
- [elpa] externals/company ec587719e3 12/30: company-etags: CAPF match highlighting, ELPA Syncer, 2024/07/13
- [elpa] externals/company 92ebedd921 28/30: Better summary, fixed url, ELPA Syncer, 2024/07/13
- [elpa] externals/company 21bfd9cbc7 29/30: Fix "sneaky refresh" when boundaries are used, ELPA Syncer, 2024/07/13
- [elpa] externals/company 0de16299dc 26/30: Make sure to redraw popup when boundaries change, ELPA Syncer, 2024/07/13