Merge pull request #116 from mygoare/patch-1

ruby: make each_with_index snippet consistent with the rest of the file.
This commit is contained in:
Holger Rapp 2013-12-02 22:29:54 -08:00
commit f292def2ed

View File

@ -355,7 +355,7 @@ endsnippet
snippet "(\S+)\.Each_w(ith)?_?i(ndex)?" ".each_with_index { |<element>,<i>| <block> }" r snippet "(\S+)\.Each_?w(ith)?_?i(ndex)?" ".each_with_index { |<element>,<i>| <block> }" r
`!p snip.rv=match.group(1)`.each_with_index { |${1:`!p `!p snip.rv=match.group(1)`.each_with_index { |${1:`!p
element_name = match.group(1).lstrip('$@') element_name = match.group(1).lstrip('$@')
ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)