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

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

[elpa] master 77fb030 052/348: ivy.el (ivy-completion-in-region): Fix co


From: Oleh Krehel
Subject: [elpa] master 77fb030 052/348: ivy.el (ivy-completion-in-region): Fix common length longer than str
Date: Sat, 8 Apr 2017 11:03:23 -0400 (EDT)

branch: master
commit 77fb0301d198d3cbe1136e86b4cbd926de11f6a2
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy-completion-in-region): Fix common length longer than str
    
    Example: (setq tab-indent) completes to `tab-always-indent' which has
    'completion-common-length property longer than the original string.
    
    Re #528
---
 ivy.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ivy.el b/ivy.el
index 91c89e5..30d9f0a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1673,11 +1673,13 @@ The previous string is between `ivy-completion-beg' and 
`ivy-completion-end'."
          (str (buffer-substring-no-properties start end))
          (completion-ignore-case case-fold-search)
          (comps
-          (completion-all-completions str collection predicate (- end start))))
+          (completion-all-completions str collection predicate (- end start)))
+         (len (min (ivy-completion-common-length (car comps))
+                   (length str))))
     (if (null comps)
         (message "No matches")
       (nconc comps nil)
-      (setq ivy-completion-beg (- end (ivy-completion-common-length (car 
comps))))
+      (setq ivy-completion-beg (- end len))
       (setq ivy-completion-end end)
       (if (null (cdr comps))
           (if (string= str (car comps))



reply via email to

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