aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-27 19:08:03 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-27 19:08:03 +0000
commit59044256388097bc19fb122f1d9058bf338eb5a1 (patch)
treec8a5eb2421ba20ca7de26b5140300849a1a10a5b /Source
parent98d651758a14f1675a605000cd1813d7fc64695a (diff)
downloadsequelpro-59044256388097bc19fb122f1d9058bf338eb5a1.tar.gz
sequelpro-59044256388097bc19fb122f1d9058bf338eb5a1.tar.bz2
sequelpro-59044256388097bc19fb122f1d9058bf338eb5a1.zip
• Query Favorite text macro
- fixed bug for deletion nested snippet ranges after editing - further improvement of the graphical representation - selected snippet will be drawn differently
Diffstat (limited to 'Source')
-rw-r--r--Source/CMTextView.m43
1 files changed, 24 insertions, 19 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index cadd71c4..c656be13 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -2882,13 +2882,16 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
NSRange glRange = [[self layoutManager] glyphRangeForCharacterRange:NSMakeRange(snippetControlArray[i][0],snippetControlArray[i][1]) actualCharacterRange:NULL];
if(glRange.length) {
NSRect boundingRect = [[self layoutManager] boundingRectForGlyphRange:glRange inTextContainer:[self textContainer]];
- boundingRect = NSInsetRect(boundingRect, -4, -1);
- NSBezierPath *aBezierPath = [NSBezierPath bezierPathWithRoundedRect:boundingRect xRadius:5 yRadius:10];
- [[NSColor colorWithCalibratedRed:1.0 green:1. blue:0.0 alpha:0.4] setFill];
+ boundingRect = NSInsetRect(boundingRect, -4, 0.2);
+ NSBezierPath *aBezierPath = [NSBezierPath bezierPathWithRoundedRect:boundingRect xRadius:6 yRadius:10];
+ if(i == currentSnippetIndex)
+ [[NSColor colorWithCalibratedRed:1.0 green:0.3 blue:0.0 alpha:0.7] setFill];
+ else
+ [[NSColor colorWithCalibratedRed:1.0 green:1.0 blue:0.0 alpha:0.4] setFill];
[aBezierPath fill];
boundingRect = NSInsetRect(boundingRect, 2, 2);
- aBezierPath = [NSBezierPath bezierPathWithRoundedRect:boundingRect xRadius:5 yRadius:10];
- [[NSColor colorWithCalibratedRed:1.0 green:1. blue:1.0 alpha:0.8] setFill];
+ aBezierPath = [NSBezierPath bezierPathWithRoundedRect:boundingRect xRadius:6 yRadius:10];
+ [[NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:0.8] setFill];
[aBezierPath fill];
}
}
@@ -3065,20 +3068,22 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
NSInteger i;
// Remove any fully nested snippets relative to the current snippet which was edited
- if(snippetControlArray[i][0] > -1 && i != snippetControlMax) {
- NSInteger currentSnippetLocation = snippetControlArray[currentSnippetIndex][0];
- NSInteger currentSnippetMaxRange = snippetControlArray[currentSnippetIndex][0] + snippetControlArray[currentSnippetIndex][1];
- for(i=0; i<snippetControlMax; i++) {
- if(snippetControlArray[i][0] > -1
- && i != currentSnippetIndex
- && snippetControlArray[i][0] >= currentSnippetLocation
- && snippetControlArray[i][0] <= currentSnippetMaxRange
- && snippetControlArray[i][0] + snippetControlArray[i][1] >= currentSnippetLocation
- && snippetControlArray[i][0] + snippetControlArray[i][1] <= currentSnippetMaxRange
- ) {
- snippetControlArray[i][0] = -1;
- snippetControlArray[i][1] = -1;
- snippetControlArray[i][2] = -1;
+ for(i=0; i<snippetControlMax; i++) {
+ if(snippetControlArray[i][0] > -1 && i != snippetControlMax) {
+ NSInteger currentSnippetLocation = snippetControlArray[currentSnippetIndex][0];
+ NSInteger currentSnippetMaxRange = snippetControlArray[currentSnippetIndex][0] + snippetControlArray[currentSnippetIndex][1];
+ for(i=0; i<snippetControlMax; i++) {
+ if(snippetControlArray[i][0] > -1
+ && i != currentSnippetIndex
+ && snippetControlArray[i][0] >= currentSnippetLocation
+ && snippetControlArray[i][0] <= currentSnippetMaxRange
+ && snippetControlArray[i][0] + snippetControlArray[i][1] >= currentSnippetLocation
+ && snippetControlArray[i][0] + snippetControlArray[i][1] <= currentSnippetMaxRange
+ ) {
+ snippetControlArray[i][0] = -1;
+ snippetControlArray[i][1] = -1;
+ snippetControlArray[i][2] = -1;
+ }
}
}
}