summaryrefslogtreecommitdiff
path: root/helm-multi-match.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-03-28 07:36:50 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-03-28 07:40:06 +0200
commit30435e76ab515e1a2bfd6e3822c74de49763596f (patch)
tree4686bceba3925bfc0e7cda11a85e0fd01f23c7df /helm-multi-match.el
parent9ddc8670fda3e567d756a0a4dc4de5b930176a79 (diff)
Restore previous code in helm-mm-split-pattern and fixit.
* helm-multi-match.el (helm-mm-space-regexp): Restored to defconst. (helm-mm-split-pattern): Fix by matching spaces litteraly.
Diffstat (limited to 'helm-multi-match.el')
-rw-r--r--helm-multi-match.el13
1 files changed, 5 insertions, 8 deletions
diff --git a/helm-multi-match.el b/helm-multi-match.el
index 36a7a15d..f16272ab 100644
--- a/helm-multi-match.el
+++ b/helm-multi-match.el
@@ -63,7 +63,7 @@ when these options are used."
;;; Build regexps
;;
;;
-(defvar helm-mm-space-regexp "[\\ ] "
+(defconst helm-mm-space-regexp "\\s\\\\s-"
"Regexp to represent space itself in multiple regexp match.")
(defun helm-mm-split-pattern (pattern)
@@ -71,13 +71,10 @@ when these options are used."
If spaces in PATTERN are escaped, don't split at this place.
i.e \"foo bar baz\"=> (\"foo\" \"bar\" \"baz\")
but \"foo\\ bar baz\"=> (\"foo\\s-bar\" \"baz\")."
- (if (string= pattern "")
- '("")
- (cl-loop for s in (split-string
- (replace-regexp-in-string helm-mm-space-regexp
- "\000\000" pattern)
- " " t)
- collect (replace-regexp-in-string "\000\000" " " s))))
+ (split-string
+ ;; Match spaces litteraly because candidate buffer syntax-table
+ ;; doesn't understand "\s-" properly.
+ (replace-regexp-in-string helm-mm-space-regexp "\\\\s-" pattern nil t)))
(defun helm-mm-1-make-regexp (pattern)
"Replace spaces in PATTERN with \"\.*\"."