From 79bf97de1dc30afb75a07958ff99b6f95473383e Mon Sep 17 00:00:00 2001 From: Bibiko Date: Sun, 21 Nov 2010 19:42:42 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20line=20numbering=20and=20current=20?= =?UTF-8?q?line=20highlighting=20to=20Bundle=20Editor's=20command=20text?= =?UTF-8?q?=20view=20=E2=80=A2=20made=20each=20Bundle=20in/ouptut=20file?= =?UTF-8?q?=20name=20unique=20to=20allow=20to=20run=20different=20Bundle?= =?UTF-8?q?=20commands=20at=20the=20same=20time=20=E2=80=A2=20fixed=20mino?= =?UTF-8?q?r=20issues=20for=20Bundle=20Editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTextView.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/SPTextView.m') diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 0af0b2ff..b7e39a39 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -3453,10 +3453,11 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) NSString *inputAction = @""; NSString *inputFallBackAction = @""; NSError *err = nil; + NSString *bundleInputFilePath = [NSString stringWithFormat:@"%@_%@", SPBundleTaskInputFilePath, [NSString stringWithNewUUID]]; NSRange currentWordRange, currentQueryRange, currentSelectionRange, currentLineRange; - [[NSFileManager defaultManager] removeItemAtPath:SPBundleTaskInputFilePath error:nil]; + [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; if([cmdData objectForKey:SPBundleFileInputSourceKey]) inputAction = [[cmdData objectForKey:SPBundleFileInputSourceKey] lowercaseString]; @@ -3494,7 +3495,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) NSMutableDictionary *env = [NSMutableDictionary dictionary]; [env setObject:[infoPath stringByDeletingLastPathComponent] forKey:@"SP_BUNDLE_PATH"]; - [env setObject:SPBundleTaskInputFilePath forKey:@"SP_BUNDLE_INPUT_FILE"]; + [env setObject:bundleInputFilePath forKey:@"SP_BUNDLE_INPUT_FILE"]; if(currentSelectionRange.length) [env setObject:[[self string] substringWithRange:currentSelectionRange] forKey:@"SP_SELECTED_TEXT"]; @@ -3510,7 +3511,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) NSError *inputFileError = nil; NSString *input = [NSString stringWithString:[[self string] substringWithRange:replaceRange]]; - [input writeToFile:SPBundleTaskInputFilePath + [input writeToFile:bundleInputFilePath atomically:YES encoding:NSUTF8StringEncoding error:&inputFileError]; @@ -3525,7 +3526,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) NSString *output = [cmd runBashCommandWithEnvironment:env atCurrentDirectoryPath:nil error:&err]; - [[NSFileManager defaultManager] removeItemAtPath:SPBundleTaskInputFilePath error:nil]; + [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; if(err == nil && output && [cmdData objectForKey:SPBundleFileOutputActionKey]) { if([[cmdData objectForKey:SPBundleFileOutputActionKey] length] -- cgit v1.2.3