Skip to content

Commit

Permalink
ruby: count from 1, not 0 (I think its very important to think about …
Browse files Browse the repository at this point in the history
…the name)

 add static_var snippet
  • Loading branch information
MarcWeber committed Aug 8, 2013
1 parent b2771b3 commit c0cddc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions UltiSnips/ruby.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ end
endsnippet

snippet dov "do |<key>| ... end" i
do |${0:v}|
$1
do |${1:v}|
$2
end
endsnippet

Expand Down
7 changes: 7 additions & 0 deletions snippets/php.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,10 @@ snippet aw
array_walk($${1:foo}, function(&$${2:v}, $${3:k}) {
$$2 = ${4};
});

# static var assign once
snippet static_var
static $${1} = null;
if (is_null($$1)){
$$1 = ${2};
}
4 changes: 2 additions & 2 deletions snippets/ruby.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ snippet do
# not be worth adding another snippet. should 0/1 placeholders change order?
# its a good idea to think about the var name, so use it first
snippet dov
do |${0:v}|
${1}
do |${1:v}|
${2}
end
snippet :
:${1:key} => ${2:"value"}${3}
Expand Down

0 comments on commit c0cddc9

Please sign in to comment.