[TxMt] Re: Pasteboard Format for pasting columns
Allan Odgaard
mailinglist at textmate.org
Sun May 30 11:13:33 UTC 2010
On 29 May 2010, at 23:16, Joshua Shapiro wrote:
> [...] Is there a way I can format this string data so that textmate
> recognizes it is a columnar selection?
You need to store a property list as the OakTextMatePboardType with a
‘content’ key (actual string) and ‘rectangular’ set to the string
value YES.
E.g.:
id plist = [NSDictionary dictionaryWithObjectsAndKeys:
@"foo\nbar\n", @"content",
@"YES", @"rectangular",
nil
];
NSPasteboard* pboard = [NSPasteboard generalPasteboard];
[pboard declareTypes:[NSArray
arrayWithObject:@"OakTextMatePboardType"] owner:nil];
[pboard setPropertyList:plist forType:@"OakTextMatePboardType"];
In practice you also want to provide an NSStringPboardType alternative.
Note that this is not a documented pasteboard type so no guarantees
about future compatibility with this format etc.
More information about the textmate
mailing list