From 59044256388097bc19fb122f1d9058bf338eb5a1 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 27 Jan 2010 19:08:03 +0000 Subject: =?UTF-8?q?=E2=80=A2=20Query=20Favorite=20text=20macro=20-=20fixed?= =?UTF-8?q?=20bug=20for=20deletion=20nested=20snippet=20ranges=20after=20e?= =?UTF-8?q?diting=20-=20further=20improvement=20of=20the=20graphical=20rep?= =?UTF-8?q?resentation=20-=20selected=20snippet=20will=20be=20drawn=20diff?= =?UTF-8?q?erently?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CMTextView.m | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'Source') 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 -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 -1 && i != snippetControlMax) { + NSInteger currentSnippetLocation = snippetControlArray[currentSnippetIndex][0]; + NSInteger currentSnippetMaxRange = snippetControlArray[currentSnippetIndex][0] + snippetControlArray[currentSnippetIndex][1]; + for(i=0; i -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; + } } } } -- cgit v1.2.3