aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-15 09:37:11 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-15 09:37:11 +0000
commite3d1b3567632352decc184d64b3e0fed82e11554 (patch)
tree2887c68140442cb9c3e4356b3ea580e313fd84d6 /Source/CMTextView.m
parent96813948c1ceee59be105bdf7a79f77db103fe5c (diff)
downloadsequelpro-e3d1b3567632352decc184d64b3e0fed82e11554.tar.gz
sequelpro-e3d1b3567632352decc184d64b3e0fed82e11554.tar.bz2
sequelpro-e3d1b3567632352decc184d64b3e0fed82e11554.zip
• corrected regexp for parsing text macro snippets
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r--Source/CMTextView.m6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 0caa12c0..582df6c2 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -1132,7 +1132,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
NSMutableString *snip = [[NSMutableString alloc] initWithCapacity:[theSnippet length]];
@try{
- NSString *re = @"(?s)(?<!\\\\)\\$\\{(1?\\d):(.{0}|.*?[^\\\\])\\}";
+ NSString *re = @"(?s)(?<!\\\\)\\$\\{(1?\\d):(.{0}|[^{}]*?[^\\\\])\\}";
if(targetRange.length)
targetRange = NSIntersectionRange(NSMakeRange(0,[[self string] length]), targetRange);
@@ -1236,10 +1236,10 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
// Adjust successive snippets
for(i=0; i<20; i++)
if(snippetControlArray[i][0] > -1 && i != snipCnt && snippetControlArray[i][0] > snippetControlArray[snipCnt][0])
- snippetControlArray[i][0] -= 3+((snipCnt>9)?2:1); // 3 := length(${:)
+ snippetControlArray[i][0] -= 3+((snipCnt>9)?2:1);
}
-
+
if(snippetControlCounter > -1) {
// Store the end for tab out
snippetControlMax++;