diff options
| author | Omar Antolín <omar.antolin@gmail.com> | 2020-04-17 01:15:05 -0500 |
|---|---|---|
| committer | Omar Antolín <omar.antolin@gmail.com> | 2020-04-17 01:15:05 -0500 |
| commit | 3b2741737b9e411362e6a8612487da3fe58132ab (patch) | |
| tree | 5a36d2a7ec758ce47136bca1ca82694a1feaa414 | |
| parent | cacd856f9abf9c14fae223e82bb59dda0d2b42af (diff) | |
Fix regression bug on no matches
| -rw-r--r-- | orderless.el | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/orderless.el b/orderless.el index c250054..67f71a7 100644 --- a/orderless.el +++ b/orderless.el @@ -123,25 +123,26 @@ This function is part of the `orderless' completion style." orderless-regexp-separator t)) (completions (all-completions prefix table pred))) - (when minibuffer-completing-file-name - (setq completions - (completion-pcm--filename-try-filter completions))) - (nconc - (cl-loop for candidate in completions - collect (orderless--highlight-matches - completion-regexp-list - candidate)) - limit))) + (when completions + (when minibuffer-completing-file-name + (setq completions + (completion-pcm--filename-try-filter completions))) + (nconc + (cl-loop for candidate in completions + collect (orderless--highlight-matches + completion-regexp-list + candidate)) + limit)))) (invalid-regexp nil))) (defun orderless-try-completion (string table pred point &optional _metadata) "Complete STRING to unique matching entry in TABLE. This uses `orderless-all-completions' to find matches for STRING -in TABLE among entries satisfying PRED (that function ignores -POINT). If there is only one match, it completes to that match. -If there are no matches, it returns nil. In any other case it -\"completes\" STRING to itself. This function is part of the -`orderless' completion style." +in TABLE among entries satisfying PRED. If there is only one +match, it completes to that match. If there are no matches, it +returns nil. In any other case it \"completes\" STRING to +itself, without moving POINT. +This function is part of the `orderless' completion style." (let* ((limit (car (completion-boundaries string table pred ""))) (prefix (substring string 0 limit)) (all (orderless-all-completions string table pred point))) |
