mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Updates to imported ruby-mode block snippets.
This commit is contained in:
parent
fb1a98dcbf
commit
ca2b25e84a
@ -4,6 +4,6 @@
|
||||
# name: Insert do |variable| … end
|
||||
## condition: "source.ruby"
|
||||
# --
|
||||
do${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${1:variable}${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}
|
||||
do ${1:$(if (string= yas/text "") "" "|")}${1:variable}${1:$(if (string= yas/text "") "" "|")}
|
||||
$0
|
||||
end
|
@ -4,4 +4,4 @@
|
||||
# name: lambda { |args| .. }
|
||||
## condition: "source.ruby"
|
||||
# --
|
||||
lambda { ${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:args}${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
|
||||
lambda { ${1:$(if (string= yas/text "") "" "|")}${1:args}${1:$(if (string= yas/text "") "" "|")}$0 }
|
@ -1,7 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: {
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# assumes some sort of autopairing of the braces such as autopair.el or ruby electric
|
||||
# that would have added the closing brace.
|
||||
# name: Insert { |variable| … }
|
||||
## condition: "source.ruby - string - comment"
|
||||
# --
|
||||
{ ${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:variable}${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}${2:`yas/selected-text`}
|
||||
{ ${1:$(if (string= yas/text "") "" "|")}${1:variable}${1:$(if (string= yas/text "") "" "|")}${2:`yas/selected-text`}
|
Loading…
x
Reference in New Issue
Block a user