Use escape sequence for line endings

This is to make the tmProperties file more transparent (should the user wish to manually inspect it).

As the variable part in the settings is treated as a format string, we can use ‘\r’ and ‘\n’ for CR and LF respectively.
This commit is contained in:
Allan Odgaard
2012-08-25 14:51:41 +02:00
parent 00ed4cab68
commit 895dd9a1bd
2 changed files with 2 additions and 2 deletions

View File

@@ -515,7 +515,7 @@
<string key="NSKeyPath">lineEndings</string>
<object class="NSDictionary" key="NSOptions">
<string key="NS.key.0">NSValueTransformerName</string>
<string key="NS.object.0">OakLineEndingsTransformer</string>
<string key="NS.object.0">OakLineEndingsSettingsTransformer</string>
</object>
<int key="NSNibBindingConnectorVersion">2</int>
</object>

View File

@@ -14,7 +14,7 @@
{
if(self = [super initWithNibName:@"FilesPreferences" label:@"Files" image:[NSImage imageNamed:NSImageNameMultipleDocuments]])
{
[OakStringListTransformer createTransformerWithName:@"OakLineEndingsTransformer" andObjectsArray:@[ @"\n", @"\r", @"\r\n" ]];
[OakStringListTransformer createTransformerWithName:@"OakLineEndingsSettingsTransformer" andObjectsArray:@[ @"\\n", @"\\r", @"\\r\\n" ]];
self.defaultsProperties = @{
@"disableSessionRestore" : kUserDefaultsDisableSessionRestoreKey,