diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-01-10 11:52:14 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-01-10 11:52:14 +0100 |
commit | aa8f705d090f62621efa61c7cbc49d91e45cddde (patch) | |
tree | c822ac1f3e02081ebc8b6a61141998e977098b7b /helm-locate.el | |
parent | ae7e8b57c6337bb82f7683965d488b3f8b474ff4 (diff) |
Fuzzy match on basename in locate.
* helm-locate.el (helm-locate-fuzzy-sort-fn):
Use helm-locate-default-fuzzy-sort-fn.
(helm-locate-default-fuzzy-sort-fn): New.
* helm.el (helm-fuzzy-matching-default-sort-fn-1): Takes one more arg basename.
Diffstat (limited to 'helm-locate.el')
-rw-r--r-- | helm-locate.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/helm-locate.el b/helm-locate.el index f3c58ccd..135a9217 100644 --- a/helm-locate.el +++ b/helm-locate.el @@ -96,7 +96,7 @@ Note that when this is enabled searching is done on basename." :type 'boolean) (defcustom helm-locate-fuzzy-sort-fn - #'helm-fuzzy-matching-default-sort-fn-1 + #'helm-locate-default-fuzzy-sort-fn "Default fuzzy matching sort function for locate." :group 'helm-locate :type 'boolean) @@ -325,6 +325,11 @@ See also `helm-locate'." (helm-log "Error: Locate %s" (replace-regexp-in-string "\n" "" event)))))))))) +(defun helm-locate-default-fuzzy-sort-fn (candidates) + "Default sort function for files in fuzzy matching. +Sort is done on basename of CANDIDATES." + (helm-fuzzy-matching-default-sort-fn-1 candidates nil t)) + (defclass helm-locate-source (helm-source-async helm-type-file) ((init :initform 'helm-locate-set-command) (candidates-process :initform 'helm-locate-init) |