summaryrefslogtreecommitdiff
path: root/helm-locate.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-01-12 09:25:09 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-01-12 09:25:09 +0100
commitca4e977882bccb5400e1104ba7c609d7b639e3b3 (patch)
treeb2a3f171bc31f7c1e3a1d2997cf6ff57076c9884 /helm-locate.el
parent665ff22fee4db678cc961da4d6680301717c764c (diff)
Highlight basename of candidate when -b is detected at end of pattern.
* helm-locate.el (helm-source-locate): Do it.
Diffstat (limited to 'helm-locate.el')
-rw-r--r--helm-locate.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/helm-locate.el b/helm-locate.el
index 2002653d..2023b65f 100644
--- a/helm-locate.el
+++ b/helm-locate.el
@@ -346,9 +346,12 @@ Sort is done on basename of CANDIDATES."
(defvar helm-source-locate
(helm-make-source "Locate" 'helm-locate-source
:pattern-transformer 'helm-locate-pattern-transformer
+ ;; :match-part is only used here to tell helm which part
+ ;; of candidate to highlight.
:match-part (lambda (candidate)
- (if (and helm-locate-fuzzy-match
- (not (string-match "\\s-" helm-pattern)))
+ (if (or (string-match-p " -b\\'" helm-pattern)
+ (and helm-locate-fuzzy-match
+ (not (string-match "\\s-" helm-pattern))))
(helm-basename candidate)
candidate))))