Don't recreate the whole log string each time a line is removed.

This commit is contained in:
Mitchell Livingston 2006-08-24 02:04:54 +00:00
parent 5afda00ddc
commit e4480f7a97
1 changed files with 4 additions and 5 deletions

View File

@ -118,14 +118,13 @@
NSString * text = [fTextView string]; NSString * text = [fTextView string];
unsigned int loc = [text rangeOfString: @"\n"].location; unsigned int loc = [text rangeOfString: @"\n"].location;
if (loc != NSNotFound) if (loc != NSNotFound)
[fTextView setString: [[text substringFromIndex: loc + 1] stringByAppendingString: messageString]]; [[fTextView textStorage] deleteCharactersInRange: NSMakeRange(0, loc + 1)];
} }
else else
{
[[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc] initWithString:
messageString attributes: fAttributes] autorelease]];
fLines++; fLines++;
}
[[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc] initWithString:
messageString attributes: fAttributes] autorelease]];
} }
tr_freeMessageList(messages); tr_freeMessageList(messages);