diff --git a/Commands/@variable ||= memoized.tmCommand b/Commands/@variable ||= memoized.tmCommand new file mode 100644 index 0000000..b78ae63 --- /dev/null +++ b/Commands/@variable ||= memoized.tmCommand @@ -0,0 +1,39 @@ + + + + + beforeRunningCommand + nop + command + #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU + +line_number = ENV['TM_LINE_NUMBER'].to_i - 1 +line = STDIN.lines.to_a[line_number-1] + +ivar_name = 'instance_variable' +ivar_name = $1 if line =~ /def (?:self\.)?([a-z\d_]+)/i + +print "@${1:#{ivar_name}} ||= $0" + + input + document + inputFormat + text + name + @variable ||= memoized + outputCaret + afterOutput + outputFormat + snippet + outputLocation + atCaret + scope + source.ruby + tabTrigger + @ + uuid + 20ACDEEE-1F1D-4CFB-8B66-940E902693EF + version + 2 + + diff --git a/info.plist b/info.plist index ace8fee..99f2a31 100644 --- a/info.plist +++ b/info.plist @@ -87,6 +87,7 @@ 0BA2B2F1-E767-4A03-9791-0AC0183251F1 B46D35B8-5DEB-4C10-A110-BA1965A2EB9C 97054C4D-E4A3-45B1-9C00-B82DBCB30CAD + 20ACDEEE-1F1D-4CFB-8B66-940E902693EF ------------------------------------ 2BB6D28F-914E-4132-BC53-E43CF5060BFA