summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Antolín <omar.antolin@gmail.com>2022-09-17 19:48:56 -0500
committerOmar Antolín <omar.antolin@gmail.com>2022-09-17 19:48:56 -0500
commit6b86527b30ef96e047d97e314ac640a410891d1f (patch)
treec84a1df657a556d6aeb361305f2ca0ca7985e8a7
parente0b2b74d71d96c2da74a79bfef6aec197887ce86 (diff)
Flex matching: more efficient regexp, better highlighting
Fix #119 using @minad's suggestion.
-rw-r--r--orderless.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/orderless.el b/orderless.el
index 0d99e35..c6c6450 100644
--- a/orderless.el
+++ b/orderless.el
@@ -199,8 +199,10 @@ sequence."
"Match a component in flex style.
This means the characters in COMPONENT must occur in the
candidate in that order, but not necessarily consecutively."
- (orderless--separated-by '(zero-or-more nonl)
- (cl-loop for char across component collect char)))
+ (rx-to-string
+ `(seq
+ ,@(cdr (cl-loop for char across component
+ append `((zero-or-more (not ,char)) (group ,char)))))))
(defun orderless-initialism (component)
"Match a component as an initialism.