[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8cc284e 162/173: Merge pull request #531 from juergenhoetz
From: |
Dmitry Gutov |
Subject: |
[elpa] master 8cc284e 162/173: Merge pull request #531 from juergenhoetzel/master |
Date: |
Thu, 23 Jun 2016 00:28:47 +0000 (UTC) |
branch: master
commit 8cc284ee4eea8f8a1d870f91585f7a1827b40129
Merge: 2d9bf1e b8f8777
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #531 from juergenhoetzel/master
New transformer: company-sort-prefer-same-case-prefix
---
company.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/company.el b/company.el
index 443e638..28ed56b 100644
--- a/company.el
+++ b/company.el
@@ -465,6 +465,8 @@ without duplicates."
(const :tag "Sort by occurrence" (company-sort-by-occurrence))
(const :tag "Sort by backend importance"
(company-sort-by-backend-importance))
+ (const :tag "Prefer case sensitive prefix"
+ (company-sort-prefer-same-case-prefix))
(repeat :tag "User defined" (function))))
(defcustom company-completion-started-hook nil
@@ -1331,6 +1333,16 @@ from the rest of the backends in the group, if any, will
be left at the end."
(let ((b1 (get-text-property 0 'company-backend c1)))
(or (not b1) (not (memq b1 low-priority)))))))))))
+(defun company-sort-prefer-same-case-prefix (candidates)
+ "Prefer CANDIDATES with the same case sensitive prefix.
+If a backend returns case insensitive matches, candidates with the an exact
+prefix match will be prioritized even if this changes the lexical order."
+ (cl-loop for candidate in candidates
+ if (string-prefix-p company-prefix candidate)
+ collect candidate into same-case
+ else collect candidate into other-case
+ finally return (append same-case other-case)))
+
(defun company-idle-begin (buf win tick pos)
(and (eq buf (current-buffer))
(eq win (selected-window))
- [elpa] master e251568 137/173: Update test for the latest change, (continued)
- [elpa] master e251568 137/173: Update test for the latest change, Dmitry Gutov, 2016/06/22
- [elpa] master 7afffbc 068/173: Spell "backend" and "frontend" without hyphens, Dmitry Gutov, 2016/06/22
- [elpa] master 5565541 126/173: Option to have tempo expand tags after completion., Dmitry Gutov, 2016/06/22
- [elpa] master ec9f6c7 127/173: Moved company-tempo-insert call to post-completion, Dmitry Gutov, 2016/06/22
- [elpa] master bdf6b22 138/173: Fix #474 by filtering dabbrev completions at the end, Dmitry Gutov, 2016/06/22
- [elpa] master e65ab4c 111/173: Merge pull request #453 from jtatarik/bbdb-multiple-recipients, Dmitry Gutov, 2016/06/22
- [elpa] master 077182c 154/173: Add autoload cookies, Dmitry Gutov, 2016/06/22
- [elpa] master a619a93 132/173: Merge pull request #465 from vspinu/files-optim, Dmitry Gutov, 2016/06/22
- [elpa] master e357eb6 164/173: Remove the [return] binding (#530), Dmitry Gutov, 2016/06/22
- [elpa] master b8f8777 161/173: New transformer: company-sort-prefer-same-case-prefix, Dmitry Gutov, 2016/06/22
- [elpa] master 8cc284e 162/173: Merge pull request #531 from juergenhoetzel/master,
Dmitry Gutov <=
- [elpa] master 387b4d1 106/173: Fix "obsolete function" warning, Dmitry Gutov, 2016/06/22
- [elpa] master 0a6bfa9 108/173: company-capf: Add :company-prefix-length property function, Dmitry Gutov, 2016/06/22
- [elpa] master 1f5389b 146/173: Merge pull request #483 from stardiviner/add-julia-keywords, Dmitry Gutov, 2016/06/22
- [elpa] master 6c8763a 151/173: Fixed lighter for grouped backends, Dmitry Gutov, 2016/06/22
- [elpa] master 7d0db9e 135/173: Move company-files closer to the front of company-backends, Dmitry Gutov, 2016/06/22
- [elpa] master b001e91 099/173: Fix a test (after adding `should`), Dmitry Gutov, 2016/06/22
- [elpa] master 779de03 117/173: Merge pull request #457 from cpitclaudel/wip-simplify-electric, Dmitry Gutov, 2016/06/22
- [elpa] master faa8f84 120/173: Add company-semantic-insert-arguments, Dmitry Gutov, 2016/06/22
- [elpa] master c357d5a 144/173: company-grab-line: Make it work in ERC prompt, Dmitry Gutov, 2016/06/22
- [elpa] master a53911c 130/173: Separate sort of candidates and children in company-files, Dmitry Gutov, 2016/06/22