aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-21 19:42:42 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-21 19:42:42 +0000
commit79bf97de1dc30afb75a07958ff99b6f95473383e (patch)
treef789a43c40c6ff3f4c7868ba0115fc90926f8aea /Source/SPTextView.m
parentecba7ac8da8f0f2728bf23815e9103b42ec81729 (diff)
downloadsequelpro-79bf97de1dc30afb75a07958ff99b6f95473383e.tar.gz
sequelpro-79bf97de1dc30afb75a07958ff99b6f95473383e.tar.bz2
sequelpro-79bf97de1dc30afb75a07958ff99b6f95473383e.zip
• added line numbering and current line highlighting to Bundle Editor's command text view
• made each Bundle in/ouptut file name unique to allow to run different Bundle commands at the same time • fixed minor issues for Bundle Editor
Diffstat (limited to 'Source/SPTextView.m')
-rw-r--r--Source/SPTextView.m9
1 files changed, 5 insertions, 4 deletions
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]