mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 05:03:04 +00:00
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)
This commit is contained in:
parent
72c6c4cd7b
commit
35642ac007
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user