mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13: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
|
;; after the ":", this will be
|
||||||
;; caught as a mirror with
|
;; caught as a mirror with
|
||||||
;; transform later.
|
;; transform later.
|
||||||
(not (save-match-data
|
(not (string-match-p "\\`\\$[ \t\n]*("
|
||||||
(eq (string-match "$[ \t\n]*("
|
(match-string-no-properties 2)))
|
||||||
(match-string-no-properties 2)) 0)))
|
|
||||||
;; allow ${0: some exit text}
|
;; allow ${0: some exit text}
|
||||||
;; (not (and number (zerop number)))
|
;; (not (and number (zerop number)))
|
||||||
(yas--make-field number
|
(yas--make-field number
|
||||||
|
Loading…
x
Reference in New Issue
Block a user