[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 0313ad06ae 2/2: Avoid a forward-line -1 in exact matc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 0313ad06ae 2/2: Avoid a forward-line -1 in exact match |
Date: |
Sun, 10 Sep 2023 01:00:14 -0400 (EDT) |
branch: elpa/helm
commit 0313ad06ae813c4a58080ee3f493db50e3a0684e
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Avoid a forward-line -1 in exact match
---
helm-multi-match.el | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/helm-multi-match.el b/helm-multi-match.el
index e4d143e630..a0936f1e5f 100644
--- a/helm-multi-match.el
+++ b/helm-multi-match.el
@@ -94,21 +94,17 @@ If GREP-SPACE is used translate escaped space to \"\\s\"
instead of \"\\s-\"."
(defun helm-mm-exact-get-pattern (pattern)
(unless (equal pattern helm-mm-exact-pattern-str)
(setq helm-mm-exact-pattern-str pattern
- helm-mm-exact-pattern-real (concat "\n" pattern "\n")))
+ helm-mm-exact-pattern-real (concat "^" (regexp-quote pattern) "$")))
helm-mm-exact-pattern-real)
(cl-defun helm-mm-exact-match (candidate &optional (pattern helm-pattern))
(if case-fold-search
- (progn
- (setq candidate (downcase candidate)
- pattern (downcase pattern))
- (string= candidate pattern))
- (string= candidate pattern)))
+ (string= (downcase candidate) (downcase pattern))
+ (string= candidate pattern)))
(defun helm-mm-exact-search (pattern &rest _ignore)
- (and (search-forward (helm-mm-exact-get-pattern pattern) nil t)
- (forward-line -1)))
+ (re-search-forward (helm-mm-exact-get-pattern pattern) nil t))
;;; Prefix match