From a004ae168051dcfd98ec085a59b065cc007f6609 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Tue, 8 Feb 2022 02:50:37 +0800 Subject: [PATCH] Respect backend prefix --- company-fuzzy.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/company-fuzzy.el b/company-fuzzy.el index 951d90a..a316144 100644 --- a/company-fuzzy.el +++ b/company-fuzzy.el @@ -484,7 +484,7 @@ For instance, if there is a candidate function `buffer-file-name' and with current prefix `bfn'. It will just return `bfn' because the current prefix does best describe the for this candidate." (cl-case backend - (`company-capf (thing-at-point 'symbol)) + (`company-capf (company-capf 'prefix)) (`company-files ;; NOTE: For `company-files', we will return the last section of the path ;; for the best match. @@ -495,7 +495,7 @@ does best describe the for this candidate." (len-splitted (length splitted)) (last (nth (1- len-splitted) splitted))) last)) - (`company-yasnippet (thing-at-point 'symbol)) + (`company-yasnippet (company-yasnippet 'prefix)) (t company-fuzzy--prefix))) (defun company-fuzzy--backend-prefix-get (backend) @@ -522,7 +522,7 @@ P.S. Not all backend work this way." (setq new-prefix (substring prefix 0 (- (length prefix) (length last))))) new-prefix)))) - (`company-yasnippet "") + (`company-yasnippet (company-yasnippet 'prefix)) (t (ignore-errors (substring company-fuzzy--prefix 0 1))))) (defun company-fuzzy--backend-prefix (backend type)