[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9e844d1 124/173: Merge pull request #459 from fbergroth/pr
From: |
Dmitry Gutov |
Subject: |
[elpa] master 9e844d1 124/173: Merge pull request #459 from fbergroth/prefix-length-var |
Date: |
Thu, 23 Jun 2016 00:28:44 +0000 (UTC) |
branch: master
commit 9e844d1c112005d734219da3885881325ff24bfe
Merge: 1221739 4cd4c3a
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Merge pull request #459 from fbergroth/prefix-length-var
Turn :company-prefix-length property into a value
---
NEWS.md | 2 +-
company-capf.el | 9 +++------
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 33750f1..87ea896 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,7 +5,7 @@
* `company-semantic-insert-arguments`: New option. Like in `company-clang`.
* `company-semantic-begin-after-member-access`: New option. Similar to the one
in `company-clang`.
-* `company-capf` accepts `:company-prefix-length` property function.
+* `company-capf` accepts `:company-prefix-length` property value.
* New face `company-tooltip-annotation-selection`, used for the annotation in
the selected tooltip line.
* `company-clang-objc-templatify` has been renamed to
diff --git a/company-capf.el b/company-capf.el
index 6554782..9eeb248 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -72,13 +72,10 @@
(`prefix
(let ((res (company--capf-data)))
(when res
- (let* ((f (plist-get (nthcdr 4 res) :company-prefix-length))
- (beg (nth 1 res))
- (end (nth 2 res))
- (length (and f (funcall f beg (point))))
- (prefix (buffer-substring-no-properties beg (point))))
+ (let ((length (plist-get (nthcdr 4 res) :company-prefix-length))
+ (prefix (buffer-substring-no-properties (nth 1 res) (point))))
(cond
- ((> end (point)) 'stop)
+ ((> (nth 2 res) (point)) 'stop)
(length (cons prefix length))
(t prefix))))))
(`candidates
- [elpa] master 18a77b9 121/173: Improve the example in the Commentary, (continued)
- [elpa] master 18a77b9 121/173: Improve the example in the Commentary, Dmitry Gutov, 2016/06/22
- [elpa] master c97828c 142/173: Clarify where callback must be called from, Dmitry Gutov, 2016/06/22
- [elpa] master 4cd4c3a 123/173: Turn :company-prefix-length property into a value, Dmitry Gutov, 2016/06/22
- [elpa] master 18b0414 103/173: Declare python-shell-get-process, Dmitry Gutov, 2016/06/22
- [elpa] master 23c6f85 109/173: Merge pull request #450 from fbergroth/capf-prefix-function, Dmitry Gutov, 2016/06/22
- [elpa] master 5bfbb05 098/173: Add the pre-render backend command, Dmitry Gutov, 2016/06/22
- [elpa] master 3ec9d5d 145/173: Add Julia keywords, Dmitry Gutov, 2016/06/22
- [elpa] master 900ae0d 096/173: Add support for company-face, Dmitry Gutov, 2016/06/22
- [elpa] master 1221739 122/173: Improve the description of cons prefix, Dmitry Gutov, 2016/06/22
- [elpa] master ac7f816 134/173: Merge pull request #466 from tarsius/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master 9e844d1 124/173: Merge pull request #459 from fbergroth/prefix-length-var,
Dmitry Gutov <=
- [elpa] master 31780fb 114/173: Revert "company-cancel: Call frontends' 'hide before 'post-completion", Dmitry Gutov, 2016/06/22
- [elpa] master a7e4408 152/173: Merge pull request #491 from akirakyle/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master 2dd1f6a 112/173: company-cancel: Call frontends' 'hide before 'post-completion, Dmitry Gutov, 2016/06/22
- [elpa] master dc4927b 158/173: Allow company-dabbrev-ignore-buffers to be a function, Dmitry Gutov, 2016/06/22
- [elpa] master 3f1afc6 171/173: Revert "Remove the [return] binding (#530)", Dmitry Gutov, 2016/06/22
- [elpa] master 9fb6072 116/173: Reimplement -electric-do using a pre-command-hook, Dmitry Gutov, 2016/06/22
- [elpa] master c845c43 097/173: Revert "Add support for company-face", Dmitry Gutov, 2016/06/22
- [elpa] master e477eaf 107/173: Bump copyright years, Dmitry Gutov, 2016/06/22
- [elpa] master 7a05d1c 115/173: company-cancel: Call pre/post-completion at the end, Dmitry Gutov, 2016/06/22
- [elpa] master cd69d7b 119/173: Add company-semantic-begin-after-member-access, Dmitry Gutov, 2016/06/22