summaryrefslogtreecommitdiff
path: root/helm-locate.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-01-06 08:57:06 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-01-06 08:57:06 +0100
commit2c74fdefb77d04f7a9aa12c2a2d216d14f186889 (patch)
tree31f920de26e89691e65f0194d8f38f9c95c93f7d /helm-locate.el
parent6e219b763ae6f0a50b6f00b644a2f71efe552403 (diff)
Fix highlighting matches in locate.
* helm-files.el (helm-highlight-files): Use match-part fn if available. * helm-locate.el (helm-source-locate): Add a match-part fn.
Diffstat (limited to 'helm-locate.el')
-rw-r--r--helm-locate.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/helm-locate.el b/helm-locate.el
index d36cb2ad..07deb488 100644
--- a/helm-locate.el
+++ b/helm-locate.el
@@ -329,7 +329,12 @@ See also `helm-locate'."
(defvar helm-source-locate
(helm-make-source "Locate" 'helm-locate-source
- :pattern-transformer 'helm-locate-pattern-transformer))
+ :pattern-transformer 'helm-locate-pattern-transformer
+ :match-part (lambda (candidate)
+ (if (and helm-locate-fuzzy-match
+ (not (string-match "\\s-" helm-pattern)))
+ (helm-basename candidate)
+ candidate))))
(defun helm-locate-pattern-transformer (pattern)
(if helm-locate-fuzzy-match