branch: master
commit 35642ac007a63aa7bc6c50fc6fc5688bfb3b057b
Author: Noam Postavsky <[email protected]>
Commit: Noam Postavsky <[email protected]>
Simplify string matching.
* yasnippet.el (yas--field-parse-create): Use string-match-p to instead
of save-match-data, anchor regexp with \` (start of string) to instead
of (eq ... 0)
---
yasnippet.el | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 50973e9..77702eb 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -4049,9 +4049,8 @@ When multiple expressions are found, only the last one
counts."
;; after the ":", this will be
;; caught as a mirror with
;; transform later.
- (not (save-match-data
- (eq (string-match "$[ \t\n]*("
-
(match-string-no-properties 2)) 0)))
+ (not (string-match-p "\\`\\$[ \t\n]*("
+
(match-string-no-properties 2)))
;; allow ${0: some exit text}
;; (not (and number (zerop number)))
(yas--make-field number