mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-16 00:20:58 +00:00
minor optimizations
This commit is contained in:
parent
8ab1b66eb5
commit
1749847eac
1 changed files with 7 additions and 7 deletions
|
@ -1410,27 +1410,27 @@ NSUInteger FindDelimiterInString(NSString * string,
|
||||||
- (void)highlightCharacterPair:(NSTextView *)editorView
|
- (void)highlightCharacterPair:(NSTextView *)editorView
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
NSTextStorage *textStorage = [editorView textStorage];
|
||||||
|
|
||||||
|
[textStorage beginEditing];
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
if (highlighted_chars[i] == NSNotFound)
|
if (highlighted_chars[i] == NSNotFound)
|
||||||
return;
|
continue;
|
||||||
|
|
||||||
NSTextStorage *textStorage = [editorView textStorage];
|
|
||||||
NSRange r = NSMakeRange(highlighted_chars[i], 1);
|
NSRange r = NSMakeRange(highlighted_chars[i], 1);
|
||||||
NSRange tmp;
|
|
||||||
|
|
||||||
NSAssert(textStorage, @"textstorage can't be nil");
|
NSAssert(textStorage, @"textstorage can't be nil");
|
||||||
[textStorage beginEditing];
|
|
||||||
|
|
||||||
// store the previous character's attributes
|
// store the previous character's attributes
|
||||||
ASSIGN(previousBGColor,
|
ASSIGN(previousBGColor,
|
||||||
[textStorage attribute:NSBackgroundColorAttributeName
|
[textStorage attribute:NSBackgroundColorAttributeName
|
||||||
atIndex:r.location
|
atIndex:r.location
|
||||||
effectiveRange:&tmp]);
|
effectiveRange:NULL]);
|
||||||
ASSIGN(previousFont, [textStorage attribute:NSFontAttributeName
|
ASSIGN(previousFont, [textStorage attribute:NSFontAttributeName
|
||||||
atIndex:r.location
|
atIndex:r.location
|
||||||
effectiveRange:&tmp]);
|
effectiveRange:NULL]);
|
||||||
|
|
||||||
[textStorage addAttribute:NSFontAttributeName
|
[textStorage addAttribute:NSFontAttributeName
|
||||||
value:highlightFont
|
value:highlightFont
|
||||||
|
@ -1439,8 +1439,8 @@ NSUInteger FindDelimiterInString(NSString * string,
|
||||||
value:highlightColor
|
value:highlightColor
|
||||||
range:r];
|
range:r];
|
||||||
|
|
||||||
[textStorage endEditing];
|
|
||||||
}
|
}
|
||||||
|
[textStorage endEditing];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)computeNewParenthesisNesting: (NSTextView *)editorView
|
- (void)computeNewParenthesisNesting: (NSTextView *)editorView
|
||||||
|
|
Loading…
Reference in a new issue