From 40752cef83b8b7fbc8d662bd4fcf532b2250b2aa Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 16 Apr 2013 15:31:20 +0400 Subject: [PATCH] Revert "company--multi-backend-adapter: Use each respective backend's prefix" This reverts commit a982f0fe043c31aca1a11a663c41c33b76ef0c19. Maybe re-apply later; will have to save the correspondence between candidates and backends, e.g. for company-strip-prefix. --- NEWS.md | 3 --- company-tests.el | 19 ------------------- company.el | 6 +++--- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/NEWS.md b/NEWS.md index b63d5ed5c..91064a45e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,9 +2,6 @@ ## Next -* Candidates from grouped back-ends are retrieved more accurately: each - `candidates` command receives in the second argument the respective value the - back-end returned to the `prefix` command. * `company-auto-complete` is disabled by default. * `company-auto-complete-chars` default value includes fewer syntax classes. * In expanded function calls, arguments skipped by the user default to "argN". diff --git a/company-tests.el b/company-tests.el index 657486b09..309d8f1f8 100644 --- a/company-tests.el +++ b/company-tests.el @@ -159,25 +159,6 @@ (should (null company-candidates)) (should (null (company-explicit-action-p)))))) -(ert-deftest company-multi-backend-adapter-uses-respective-prefixes () - ;; And ignores the second argument. - (let ((company-backend - (list (lambda (command &optional arg) - (case command - (prefix "bar") - (candidates (mapcar (lambda (tail) (concat arg "-" tail)) - '("a" "b" "c"))))) - (lambda (command &optional arg) - (case command - (prefix "foo-bar") - (candidates (mapcar (lambda (tail) (concat arg "-" tail)) - '("d" "e")))))))) - (should (equal (sort '("bar-a" "bar-b" "bar-c" "foo-bar-d" "foo-bar-e") - 'string<) - (company-call-backend 'candidates "hubba-hubba"))))) - -;; Pseudo-Tooltip - (ert-deftest company-pseudo-tooltip-does-not-get-displaced () (with-temp-buffer (save-window-excursion diff --git a/company.el b/company.el index 3fa83534a..9f13518f0 100644 --- a/company.el +++ b/company.el @@ -658,9 +658,9 @@ keymap during active completions (`company-active-map'): (case command (candidates (loop for backend in backends - for prefix = (funcall backend 'prefix) - when prefix - append (funcall backend 'candidates prefix))) + when (equal (funcall backend 'prefix) + (car args)) + append (apply backend 'candidates args))) (sorted nil) (duplicates t) (otherwise -- 2.39.2