mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-13 14:13:02 +00:00
do not change font on highlight, just the background: thus storing the old font attributes becomes needless
This commit is contained in:
parent
a0856faf21
commit
01a3a61b2e
2 changed files with 0 additions and 27 deletions
|
@ -79,11 +79,6 @@
|
|||
// NSNotFound means not set
|
||||
NSUInteger highlighted_chars[2];
|
||||
|
||||
// the stored font attributes of the highlit character, so
|
||||
// that they can be restored later on when the character is un-highlit
|
||||
// A pair is assumed to have the same attributes
|
||||
NSColor *previousFont;
|
||||
|
||||
// This is used to protect that -textViewDidChangeSelection: invocations
|
||||
// don't do anything when the text view changing, because this causes
|
||||
// further changes to the text view and infinite recursive invocations
|
||||
|
|
|
@ -219,8 +219,6 @@
|
|||
ASSIGN(backgroundColor, [NSColor whiteColor]);
|
||||
ASSIGN(readOnlyColor, [NSColor lightGrayColor]);
|
||||
|
||||
previousFont = nil;
|
||||
|
||||
highlighted_chars[0] = NSNotFound;
|
||||
highlighted_chars[1] = NSNotFound;
|
||||
|
||||
|
@ -1376,18 +1374,6 @@ NSUInteger FindDelimiterInString(NSString * string,
|
|||
|
||||
NSRange r = NSMakeRange(highlighted_chars[i], 1);
|
||||
|
||||
// restore the character's color and font attributes
|
||||
if (previousFont != nil)
|
||||
{
|
||||
[textStorage addAttribute:NSFontAttributeName
|
||||
value:previousFont
|
||||
range:r];
|
||||
}
|
||||
else
|
||||
{
|
||||
[textStorage removeAttribute:NSFontAttributeName range:r];
|
||||
}
|
||||
|
||||
[textStorage addAttribute:NSBackgroundColorAttributeName
|
||||
value:textBackgroundColor
|
||||
range:r];
|
||||
|
@ -1414,14 +1400,6 @@ NSUInteger FindDelimiterInString(NSString * string,
|
|||
|
||||
NSAssert(textStorage, @"textstorage can't be nil");
|
||||
|
||||
// store the previous character's attributes
|
||||
ASSIGN(previousFont, [textStorage attribute:NSFontAttributeName
|
||||
atIndex:r.location
|
||||
effectiveRange:NULL]);
|
||||
|
||||
[textStorage addAttribute:NSFontAttributeName
|
||||
value:highlightFont
|
||||
range:r];
|
||||
[textStorage addAttribute:NSBackgroundColorAttributeName
|
||||
value:highlightColor
|
||||
range:r];
|
||||
|
|
Loading…
Reference in a new issue