From e4480f7a9728a20084a4ec8dbab3827dd326dd51 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 24 Aug 2006 02:04:54 +0000 Subject: [PATCH] Don't recreate the whole log string each time a line is removed. --- macosx/MessageWindowController.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index 222b742c8..ece7488fc 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -118,14 +118,13 @@ NSString * text = [fTextView string]; unsigned int loc = [text rangeOfString: @"\n"].location; if (loc != NSNotFound) - [fTextView setString: [[text substringFromIndex: loc + 1] stringByAppendingString: messageString]]; + [[fTextView textStorage] deleteCharactersInRange: NSMakeRange(0, loc + 1)]; } else - { - [[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc] initWithString: - messageString attributes: fAttributes] autorelease]]; fLines++; - } + + [[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc] initWithString: + messageString attributes: fAttributes] autorelease]]; } tr_freeMessageList(messages);