The R Project SVN R-packages

Rev

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

Rev 1562 Rev 1603
Line 452... Line 452...
452
	if (c) shColorKeyword = c;
452
	if (c) shColorKeyword = c;
453
	c=[Preferences unarchivedObjectForKey:commentSyntaxColorKey withDefault:nil];
453
	c=[Preferences unarchivedObjectForKey:commentSyntaxColorKey withDefault:nil];
454
	if (c) shColorComment = c;
454
	if (c) shColorComment = c;
455
	c=[Preferences unarchivedObjectForKey:identifierSyntaxColorKey withDefault:nil];
455
	c=[Preferences unarchivedObjectForKey:identifierSyntaxColorKey withDefault:nil];
456
	if (c) shColorIdentifier = c;
456
	if (c) shColorIdentifier = c;
-
 
457
 
-
 
458
	argsHints=[Preferences flagForKey:prefShowArgsHints withDefault:YES];
457
	
459
	
458
	[self setHighlighting:[Preferences flagForKey:showSyntaxColoringKey withDefault: YES]];
460
	[self setHighlighting:[Preferences flagForKey:showSyntaxColoringKey withDefault: YES]];
459
	showMatchingBraces = [Preferences flagForKey:showBraceHighlightingKey withDefault: YES];
461
	showMatchingBraces = [Preferences flagForKey:showBraceHighlightingKey withDefault: YES];
460
	braceHighlightInterval = [[Preferences stringForKey:highlightIntervalKey withDefault: @"0.2"] doubleValue];
462
	braceHighlightInterval = [[Preferences stringForKey:highlightIntervalKey withDefault: @"0.2"] doubleValue];
461
	[self updateSyntaxHighlightingForRange:NSMakeRange(0,[[textView textStorage] length])];
463
	[self updateSyntaxHighlightingForRange:NSMakeRange(0,[[textView textStorage] length])];
Line 773... Line 775...
773
	[self updateSyntaxHighlightingForRange:lr];
775
	[self updateSyntaxHighlightingForRange:lr];
774
	if (!deleteBackward) {
776
	if (!deleteBackward) {
775
		NSRange sr = [textView selectedRange];
777
		NSRange sr = [textView selectedRange];
776
		if (showMatchingBraces) [self highlightBracesWithShift:0 andWarn:YES];
778
		if (showMatchingBraces) [self highlightBracesWithShift:0 andWarn:YES];
777
		// check for a typed (
779
		// check for a typed (
778
		if (sr.length==0 && sr.location>0 && sr.location<[s length] && [s characterAtIndex:sr.location]=='(') {
780
		if (argsHints && sr.length==0 && sr.location>0 && sr.location<[s length] && [s characterAtIndex:sr.location]=='(') {
779
			int i = sr.location-1;
781
			int i = sr.location-1;
780
			unichar c = [s characterAtIndex:i];
782
			unichar c = [s characterAtIndex:i];
781
			BOOL hasLit = NO;
783
			BOOL hasLit = NO;
782
			while ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z') || c=='.' || c=='_') {
784
			while ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z') || c=='.' || c=='_') {
783
				if (!hasLit && ((c>='a' && c<='z') || (c>='A' && c<='Z'))) hasLit=YES;
785
				if (!hasLit && ((c>='a' && c<='z') || (c>='A' && c<='Z'))) hasLit=YES;