branch: master
commit d4d53d8709a4810dfea4fb979997d01d1e9c8eef
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-partial): Fix for fuzzy completion
Postfix doesn't always work if the completion is fuzzy, so check if
`string-match' succeeds.
Fixes #266
---
ivy.el | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/ivy.el b/ivy.el
index 155d1d5..649dcae 100644
--- a/ivy.el
+++ b/ivy.el
@@ -454,7 +454,10 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
(new (try-completion (if startp
(substring postfix 1)
postfix)
- (mapcar (lambda (str) (substring str
(string-match postfix str)))
+ (mapcar (lambda (str)
+ (let ((i (string-match postfix str)))
+ (when i
+ (substring str i))))
ivy--old-cands))))
(cond ((eq new t) nil)
((string= new ivy-text) nil)