Browse files

• introduce TM_C_POINTER and use that each time a variable is declare…

…d as a pointer — it defaults to “ *” and can thus be changed to “* ” to have “NSArray* array” inserted as “NSArray *array”.

• change $0 in some snippets to ${0:/* code */} for the semantic value.
• change ‘read file’ snippet to use ‘char’ instead of ‘uint8_t’ — I find the former easier to work with (i.e. all functions in string.h expects ‘char*’) but for that, you really should enable “treat char as unsigned” in your build settings.


git-svn-id: http://svn.textmate.org/trunk/Bundles/Objective-C.tmbundle@7278 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent fa4876f commit 842d7147c287778caadce39a08d9732dadd47c1e @sorbits sorbits committed May 17, 2007
View
2 Snippets/030 NSArray (array).plist
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>NSMutableArray *${1:array} = [NSMutableArray array];</string>
+ <string>NSMutableArray${TM_C_POINTER: *}${1:array} = [NSMutableArray array];</string>
<key>name</key>
<string>NSArray</string>
<key>scope</key>
View
2 Snippets/040 NSDictionary (dict).plist
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];</string>
+ <string>NSMutableDictionary${TM_C_POINTER: *}${1:dict} = [NSMutableDictionary dictionary];</string>
<key>name</key>
<string>NSDictionary</string>
<key>scope</key>
View
8 Snippets/Delegate Responds to Selector.plist
@@ -3,11 +3,9 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>${TM_COMMENT_START} ${4:Send ${2/\s*//g} to delegate, if it implements it}${TM_COMMENT_END}
-if ([${1:[self delegate]} respondsToSelector:@selector(${2:selfDidSomething:})])
-{
- [$1 ${3:${2/((^\s*([A-Za-z0-9_]*:)\s*)|(:\s*$)|(:\s*))/(?2:$2self :\:&lt;&gt;)(?4::)(?5: :)/g}}];
-}</string>
+ <string>if([${1:[self delegate]} respondsToSelector:@selector(${2:selfDidSomething:})])
+ [$1 ${3:${2/((^\s*([A-Za-z0-9_]*:)\s*)|(:\s*$)|(:\s*))/(?2:$2self :\:&lt;&gt;)(?4::)(?5: :)/g}}];
+</string>
<key>name</key>
<string>Delegate Responds to Selector</string>
<key>scope</key>
View
2 Snippets/IBOutlet (ibo).plist
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>IBOutlet ${1:${2:NSSomeClass} *}${3:someClass};</string>
+ <string>IBOutlet ${2:${1:NSSomeClass}${TM_C_POINTER: *}}${3:someClass};</string>
<key>name</key>
<string>IBOutlet</string>
<key>scope</key>
View
2 Snippets/NSAutoreleasePool (pool).plist
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>NSAutoreleasePool *pool = [NSAutoreleasePool new];
+ <string>NSAutoreleasePool${TM_C_POINTER: *}pool = [NSAutoreleasePool new];
$0
[pool release];</string>
<key>name</key>
View
2 Snippets/NSBezierPath (bez).plist
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>NSBezierPath *${1:path} = [NSBezierPath bezierPath];
+ <string>NSBezierPath${TM_C_POINTER: *}${1:path} = [NSBezierPath bezierPath];
$0</string>
<key>name</key>
<string>NSBezierPath</string>
View
4 Snippets/Save and Restore Graphics Context (gsave).plist
@@ -4,11 +4,9 @@
<dict>
<key>content</key>
<string>[NSGraphicsContext saveGraphicsState];
- $0
+$0
[NSGraphicsContext restoreGraphicsState];
</string>
- <key>keyEquivalent</key>
- <string></string>
<key>name</key>
<string>Save and Restore Graphics Context</string>
<key>scope</key>

0 comments on commit 842d714

Please sign in to comment.