emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 13/21: company--continue-failed: require matching input properly


From: Dmitry Gutov
Subject: [elpa] 13/21: company--continue-failed: require matching input properly
Date: Mon, 03 Feb 2014 17:36:17 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit d8df9366e687ba51f9d5700806bf87aaa296f411
Author: Dmitry Gutov <address@hidden>
Date:   Sat Feb 1 07:33:27 2014 +0200

    company--continue-failed: require matching input properly
    
    Even when it breaks prefix.
---
 company.el |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/company.el b/company.el
index c3f5b2c..14d92a1 100644
--- a/company.el
+++ b/company.el
@@ -1050,11 +1050,7 @@ Keywords and function definition names are ignored."
                                 company-point)
               company-prefix)))
 
-(defsubst company--string-incremental-p (old-prefix new-prefix)
-  (and (> (length new-prefix) (length old-prefix))
-       (equal old-prefix (substring new-prefix 0 (length old-prefix)))))
-
-(defun company--continue-failed (new-prefix)
+(defun company--continue-failed ()
   (when (company--incremental-p)
     (let ((input (buffer-substring-no-properties (point) company-point)))
       (cond
@@ -1065,8 +1061,7 @@ Keywords and function definition names are ignored."
           (let ((company--auto-completion t))
             (company-complete-selection))
           nil))
-       ((and (company--string-incremental-p company-prefix new-prefix)
-             (company-require-match-p))
+       ((company-require-match-p)
         ;; wrong incremental input, but required match
         (delete-char (- (length input)))
         (ding)
@@ -1106,7 +1101,7 @@ Keywords and function definition names are ignored."
           (setq company-prefix new-prefix)
           (company-update-candidates c)
           c)
-         (t (company--continue-failed new-prefix)))
+         (t (company--continue-failed)))
         (company-cancel))))
 
 (defun company--begin-new ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]