mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
fix: replace 'text' in 'yas-text' in bundled snippets
The previous commit broke these snippets by enabling
This commit is contained in:
parent
13d87aa3c0
commit
6ce6b24f52
@ -4,6 +4,6 @@
|
|||||||
class ${1:Name}
|
class ${1:Name}
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
${1:$(yas-substr text "[^: ]*")}($2);
|
${1:$(yas-substr yas-text "[^: ]*")}($2);
|
||||||
virtual ~${1:$(yas-substr text "[^: ]*")}();
|
virtual ~${1:$(yas-substr yas-text "[^: ]*")}();
|
||||||
};
|
};
|
@ -3,5 +3,5 @@
|
|||||||
# contributor: joaotavora
|
# contributor: joaotavora
|
||||||
# key: printf
|
# key: printf
|
||||||
# --
|
# --
|
||||||
printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);")
|
printf ("${1:%s}\\n"${1:$(if (string-match "%" yas-text) "," "\);")
|
||||||
}$2${1:$(if (string-match "%" text) "\);" "")}
|
}$2${1:$(if (string-match "%" yas-text) "\);" "")}
|
@ -5,7 +5,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// $3
|
/// $3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private $1 ${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")};
|
private $1 ${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ${3:Description}
|
/// ${3:Description}
|
||||||
@ -14,9 +14,9 @@ private $1 ${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring tex
|
|||||||
public ${1:Type} ${2:Name}
|
public ${1:Type} ${2:Name}
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
return this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")};
|
return this.${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")};
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")} = value;
|
this.${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")} = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,7 +4,7 @@
|
|||||||
# --
|
# --
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ${5:Description}
|
/// ${5:Description}
|
||||||
/// </summary>${2:$(if (string= (upcase text) "VOID") "" (format "%s%s%s" "\n/// <returns><c>" text "</c></returns>"))}
|
/// </summary>${2:$(if (string= (upcase yas-text) "VOID") "" (format "%s%s%s" "\n/// <returns><c>" yas-text "</c></returns>"))}
|
||||||
${1:public} ${2:void} ${3:MethodName}($4)
|
${1:public} ${2:void} ${3:MethodName}($4)
|
||||||
{
|
{
|
||||||
$0
|
$0
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
# key: h1
|
# key: h1
|
||||||
# --
|
# --
|
||||||
${1:Header 1}
|
${1:Header 1}
|
||||||
${1:$(make-string (string-width text) ?\=)}
|
${1:$(make-string (string-width yas-text) ?\=)}
|
||||||
|
|
||||||
$0
|
$0
|
@ -3,6 +3,6 @@
|
|||||||
# key: h2
|
# key: h2
|
||||||
# --
|
# --
|
||||||
${1:Header 2}
|
${1:Header 2}
|
||||||
${1:$(make-string (string-width text) ?\-)}
|
${1:$(make-string (string-width yas-text) ?\-)}
|
||||||
|
|
||||||
$0
|
$0
|
@ -3,4 +3,4 @@
|
|||||||
# key: ol
|
# key: ol
|
||||||
# --
|
# --
|
||||||
${1:1}. ${2:Text}
|
${1:1}. ${2:Text}
|
||||||
${1:$(number-to-string (1+ (string-to-number text)))}. $0
|
${1:$(number-to-string (1+ (string-to-number yas-text)))}. $0
|
@ -6,7 +6,7 @@
|
|||||||
return $2;
|
return $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)set${2:$(capitalize text)}:($1)aValue
|
- (void)set${2:$(capitalize yas-text)}:($1)aValue
|
||||||
{
|
{
|
||||||
[$2 autorelease];
|
[$2 autorelease];
|
||||||
$2 = [aValue retain];
|
$2 = [aValue retain];
|
||||||
|
@ -27,7 +27,7 @@ class ${1:ClassName}(${2:object}):
|
|||||||
(replace-regexp-in-string "[[:blank:]]*$" ""
|
(replace-regexp-in-string "[[:blank:]]*$" ""
|
||||||
(replace-regexp-in-string "^[[:blank:]]*" "" x))) x))
|
(replace-regexp-in-string "^[[:blank:]]*" "" x))) x))
|
||||||
(mapcar '(lambda (x) (split-string x "="))
|
(mapcar '(lambda (x) (split-string x "="))
|
||||||
(split-string text ",")))
|
(split-string yas-text ",")))
|
||||||
indent)))
|
indent)))
|
||||||
(if (string= args "")
|
(if (string= args "")
|
||||||
(make-string 3 34)
|
(make-string 3 34)
|
||||||
@ -49,7 +49,7 @@ class ${1:ClassName}(${2:object}):
|
|||||||
(replace-regexp-in-string "^[[:blank:]]*" "" x)))
|
(replace-regexp-in-string "^[[:blank:]]*" "" x)))
|
||||||
x))
|
x))
|
||||||
(mapcar '(lambda (x) (split-string x "="))
|
(mapcar '(lambda (x) (split-string x "="))
|
||||||
(split-string text ",")))
|
(split-string yas-text ",")))
|
||||||
(concat "\n" (make-string (current-column) 32)))
|
(concat "\n" (make-string (current-column) 32)))
|
||||||
}
|
}
|
||||||
$0
|
$0
|
@ -24,7 +24,7 @@ def ${1:name}($2):
|
|||||||
(replace-regexp-in-string "^[[:blank:]]*" "" x)))
|
(replace-regexp-in-string "^[[:blank:]]*" "" x)))
|
||||||
x))
|
x))
|
||||||
(mapcar '(lambda (x) (split-string x "="))
|
(mapcar '(lambda (x) (split-string x "="))
|
||||||
(split-string text ",")))
|
(split-string yas-text ",")))
|
||||||
indent)))
|
indent)))
|
||||||
(if (string= args "")
|
(if (string= args "")
|
||||||
(make-string 3 34)
|
(make-string 3 34)
|
||||||
|
@ -22,7 +22,7 @@ def ${1:name}(self, $2):
|
|||||||
(replace-regexp-in-string "^[[:blank:]]*" "" x)))
|
(replace-regexp-in-string "^[[:blank:]]*" "" x)))
|
||||||
x))
|
x))
|
||||||
(mapcar '(lambda (x) (split-string x "="))
|
(mapcar '(lambda (x) (split-string x "="))
|
||||||
(split-string text ",")))
|
(split-string yas-text ",")))
|
||||||
indent)))
|
indent)))
|
||||||
(if (string= args "")
|
(if (string= args "")
|
||||||
(make-string 3 34)
|
(make-string 3 34)
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
# key: chap
|
# key: chap
|
||||||
# --
|
# --
|
||||||
${1:Chapter}
|
${1:Chapter}
|
||||||
${1:$(make-string (string-width text) ?\=)}
|
${1:$(make-string (string-width yas-text) ?\=)}
|
||||||
|
|
||||||
$0
|
$0
|
@ -2,6 +2,6 @@
|
|||||||
# key: sec
|
# key: sec
|
||||||
# --
|
# --
|
||||||
${1:Section}
|
${1:Section}
|
||||||
${1:$(make-string (string-width text) ?\-)}
|
${1:$(make-string (string-width yas-text) ?\-)}
|
||||||
|
|
||||||
$0
|
$0
|
@ -1,8 +1,8 @@
|
|||||||
# name: Document title
|
# name: Document title
|
||||||
# key: tit
|
# key: tit
|
||||||
# --
|
# --
|
||||||
${1:$(make-string (string-width text) ?\=)}
|
${1:$(make-string (string-width yas-text) ?\=)}
|
||||||
${1:Title}
|
${1:Title}
|
||||||
${1:$(make-string (string-width text) ?\=)}
|
${1:$(make-string (string-width yas-text) ?\=)}
|
||||||
|
|
||||||
$0
|
$0
|
Loading…
x
Reference in New Issue
Block a user