[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/company a253fa5505 25/30: company-files--prefix: Captur
From: |
ELPA Syncer |
Subject: |
[elpa] externals/company a253fa5505 25/30: company-files--prefix: Capture suffix as well |
Date: |
Sat, 13 Jul 2024 00:57:52 -0400 (EDT) |
branch: externals/company
commit a253fa55059624517d4947f9a42d76bd2abfc46c
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
company-files--prefix: Capture suffix as well
No support for spaces in the suffix (escaping is hard).
#340
---
company-files.el | 4 +++-
company.el | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/company-files.el b/company-files.el
index cc15fc7017..61e8490467 100644
--- a/company-files.el
+++ b/company-files.el
@@ -129,7 +129,9 @@ Set this to nil to disable that behavior."
(all-completions file (cdr company-files--completion-cache))))
(defun company-files--prefix ()
- (company-files--grab-existing-name))
+ (let ((existing (company-files--grab-existing-name)))
+ (when existing
+ (list existing (company-grab-suffix "[^ '\"\t\n\r/]*/?")))))
(defun company-file--keys-match-p (new old)
(and (equal (cdr old) (cdr new))
diff --git a/company.el b/company.el
index c56b47c518..5ccb69fcbb 100644
--- a/company.el
+++ b/company.el
@@ -1114,6 +1114,10 @@ means that `company-mode' is always turned on except in
`message-mode' buffers."
(when (looking-back regexp limit)
(or (match-string-no-properties (or expression 0)) "")))
+(defun company-grab-suffix (regexp &optional expression)
+ (when (looking-at regexp)
+ (or (match-string-no-properties (or expression 0)) "")))
+
(defun company-grab-line (regexp &optional expression)
"Return a match string for REGEXP if it matches text before point.
If EXPRESSION is non-nil, return the match string for the respective
- [elpa] externals/company ebe5244443 07/30: Merge branch 'master' into completion_inside_symbol, (continued)
- [elpa] externals/company ebe5244443 07/30: Merge branch 'master' into completion_inside_symbol, ELPA Syncer, 2024/07/13
- [elpa] externals/company 10fcb21d46 09/30: Remove suffix after completion by company-dabbrev-code too, ELPA Syncer, 2024/07/13
- [elpa] externals/company 2fefdc7ce3 02/30: Fix test failures, ELPA Syncer, 2024/07/13
- [elpa] externals/company 436b0d6247 10/30: New backend command `adjust-boundaries`, ELPA Syncer, 2024/07/13
- [elpa] externals/company 477799b362 18/30: Make suffix matching use "proper suffix" logic by default, ELPA Syncer, 2024/07/13
- [elpa] externals/company a011dbd892 27/30: Update company-files tests, ELPA Syncer, 2024/07/13
- [elpa] externals/company 277640481a 19/30: Render the "preview" overlay over the matching suffix text, ELPA Syncer, 2024/07/13
- [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 <=
- [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, 2024/07/13
- [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