The R Project SVN R-packages

Rev

Rev 6090 | Rev 6094 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6090 Rev 6093
Line 852... Line 852...
852
 
852
 
853
}
853
}
854
 
854
 
855
-(void)resetHighlights
855
-(void)resetHighlights
856
{
856
{
-
 
857
 
857
	SLog(@"RScriptEditorTextView: resetHighlights with current highlite %d", currentHighlight);
858
	SLog(@"RScriptEditorTextView: resetHighlights with current highlite %d", currentHighlight);
858
 
859
 
859
	if (currentHighlight>-1) {
860
	if (currentHighlight>-1) {
860
		if (currentHighlight<[theTextStorage length]) {
861
		if (currentHighlight<[theTextStorage length]) {
861
			NSLayoutManager *lm = [self layoutManager];
862
			NSLayoutManager *lm = [self layoutManager];
Line 871... Line 872...
871
		}
872
		}
872
		currentHighlight=-1;
873
		currentHighlight=-1;
873
	}
874
	}
874
}
875
}
875
 
876
 
876
-(void)highlightCharacter:(int)pos
877
-(void)highlightCharacter:(NSNumber*)loc
877
{
878
{
878
 
879
 
879
	SLog(@"RScriptEditorTextView: highlightCharacter: %d", pos);
880
	SLog(@"RScriptEditorTextView: highlightCharacter: %d", pos);
880
 
881
 
881
	[self resetHighlights];
882
	NSInteger pos = [loc intValue];
882
 
883
 
883
	if (pos>=0 && pos<[[self string] length]) {
884
	if (pos>=0 && pos<[[self string] length]) {
-
 
885
 
-
 
886
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
-
 
887
		[self showFindIndicatorForRange:NSMakeRange(pos, 1)];
-
 
888
#else
-
 
889
		[self resetHighlights];
884
		NSLayoutManager *lm = [self layoutManager];
890
		NSLayoutManager *lm = [self layoutManager];
885
		if (lm) {
891
		if (lm) {
886
			currentHighlight = pos;
892
			currentHighlight = pos;
887
			[lm setTemporaryAttributes:highlightColorAttr forCharacterRange:NSMakeRange(pos, 1)];
893
			[lm setTemporaryAttributes:highlightColorAttr forCharacterRange:NSMakeRange(pos, 1)];
888
			[self performSelector:@selector(resetBackgroundColor:) withObject:nil afterDelay:braceHighlightInterval];
894
			[self performSelector:@selector(resetBackgroundColor:) withObject:nil afterDelay:braceHighlightInterval];
889
		} else SLog(@"highlightCharacter: attempt to set highlight %d beyond the text range 0:%d - I refuse!", pos, [[self string] length] - 1);
-
 
-
 
895
		}
-
 
896
 
-
 
897
#endif
-
 
898
 
890
	}
899
	}
-
 
900
	else SLog(@"highlightCharacter: attempt to set highlight %d beyond the text range 0:%d - I refuse!", pos, [[self string] length] - 1);
891
}
901
}
892
 
902
 
893
-(void)resetBackgroundColor:(id)sender
903
-(void)resetBackgroundColor:(id)sender
894
{
904
{
895
	[self resetHighlights];
905
	[self resetHighlights];