[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 09/52: company-sort-by-occurrence: include words on the same line
From: |
Dmitry Gutov |
Subject: |
[elpa] 09/52: company-sort-by-occurrence: include words on the same line, too |
Date: |
Tue, 01 Jul 2014 11:53:07 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit d10cb4f89d0f59efd99881b59c5fde97ebdff912
Author: Dmitry Gutov <address@hidden>
Date: Tue May 6 04:37:58 2014 +0400
company-sort-by-occurrence: include words on the same line, too
company--begin-new: set company-prefix earlier
Closes #107
---
company-tests.el | 3 ++-
company.el | 7 +++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/company-tests.el b/company-tests.el
index abd9704..dba9aa5 100644
--- a/company-tests.el
+++ b/company-tests.el
@@ -548,6 +548,7 @@
(with-temp-buffer
(company-mode)
(let (company-frontends
+ company-transformers
(company-backends (list 'company-async-backend)))
(company-manual-begin)
(should (equal "foo" company-prefix))
@@ -557,6 +558,7 @@
(with-temp-buffer
(company-mode)
(let (company-frontends
+ company-transformers
(company-backends (list 'company-async-backend)))
(company-idle-begin (current-buffer) (selected-window)
(buffer-chars-modified-tick) (point))
@@ -575,7 +577,6 @@
(should (null company-candidates))
(insert "a")
(sleep-for 0.1)
- (should (null company-prefix))
(should (null company-candidates)))))
(ert-deftest company-idle-begin-async-allows-immediate-callbacks ()
diff --git a/company.el b/company.el
index d4f284e..ee030e2 100644
--- a/company.el
+++ b/company.el
@@ -1176,7 +1176,7 @@ Keywords and function definition names are ignored."
(lambda (candidate)
(when (or
(save-excursion
- (progn (forward-line 0)
+ (progn (forward-char (- (length company-prefix)))
(search-backward candidate (window-start) t)))
(save-excursion
(search-forward candidate (window-end) t)))
@@ -1354,14 +1354,13 @@ Keywords and function definition names are ignored."
(company--multi-backend-adapter backend 'prefix)))
(when prefix
(when (company--good-prefix-p prefix)
- (setq prefix (or (car-safe prefix) prefix)
+ (setq company-prefix (or (car-safe prefix) prefix)
company-backend backend
- c (company-calculate-candidates prefix))
+ c (company-calculate-candidates company-prefix))
;; t means complete/unique. We don't start, so no hooks.
(if (not (consp c))
(when company--manual-action
(message "No completion found"))
- (setq company-prefix prefix)
(when company--manual-action
(setq company--manual-prefix prefix))
(when (symbolp backend)
- [elpa] branch master updated (9b6551e -> c828ee6), Dmitry Gutov, 2014/07/01
- [elpa] 01/52: Don't require pysmell during compile., Dmitry Gutov, 2014/07/01
- [elpa] 04/52: company-clang: tweak the objc args recognition, Dmitry Gutov, 2014/07/01
- [elpa] 02/52: Fix #103, Dmitry Gutov, 2014/07/01
- [elpa] 05/52: Respect tooltip align annotations in company-yasnippet., Dmitry Gutov, 2014/07/01
- [elpa] 08/52: company-search-map: bind DEL to company-search-other-char, Dmitry Gutov, 2014/07/01
- [elpa] 07/52: Account for the line continuation column in graphical mode, Dmitry Gutov, 2014/07/01
- [elpa] 09/52: company-sort-by-occurrence: include words on the same line, too,
Dmitry Gutov <=
- [elpa] 06/52: Merge pull request #106 from proofit404/master, Dmitry Gutov, 2014/07/01
- [elpa] 11/52: company-clang--build-complete-args: don't call -cc1 directly, Dmitry Gutov, 2014/07/01
- [elpa] 10/52: company--multi-backend-adapter-candidates: compare string values of prefix, Dmitry Gutov, 2014/07/01
- [elpa] 12/52: company-clang--annotation: include method qualifiers in the annotation, Dmitry Gutov, 2014/07/01
- [elpa] 13/52: NEWS: document the change in clang invocation, Dmitry Gutov, 2014/07/01
- [elpa] 14/52: company--continue: don't pass the new prefix to `company-cancel', Dmitry Gutov, 2014/07/01
- [elpa] 15/52: company-files-complete: move files in subdirs to the end, Dmitry Gutov, 2014/07/01
- [elpa] 16/52: Introduce company-tooltip-flip-when-above, Dmitry Gutov, 2014/07/01
- [elpa] 17/52: Fix typo, Dmitry Gutov, 2014/07/01
- [elpa] 18/52: extended gtags functionality #90 showing annotations and meta, Dmitry Gutov, 2014/07/01