diff --git a/yasnippet.el b/yasnippet.el index a852163..268799f 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -45,6 +45,10 @@ current column if this variable is non-`nil'.") (defstruct yas/snippet "The snippet structure of yasnippet." overlay fields exit-marker) +(defstruct yas/snippet-field-group + "A group of snippet field. They will all get updated when the +primary field is being edited." + primary fields next prev) (defstruct yas/snippet-field "The snippet-field structure of yasnippet." overlay state) @@ -56,6 +60,10 @@ current column if this variable is non-`nil'.") (defconst yas/escape-backquote (concat "YASESCAPE" "BACKQUOTE" "PROTECTGUARD")) +(defconst yas/field-regexp + (concat "$\\(?1:[0-9]+\\)" "\\|" + "${\\(?:\\(?1:[0-9]+\\):\\)?\\(?2:[^}]*\\)}")) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Internal functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -130,6 +138,8 @@ current column if `yas/indent-line' is non-`nil'." (yas/replace-all "\\`" yas/escape-backquote) (yas/replace-all "\\$" yas/escape-dollar) + ;; Step 5: Create overlays for each field + ;; Step : restore all escape characters (yas/replace-all yas/escape-dollar "$") (yas/replace-all yas/escape-backquote "`")