From f548d17e8e042fd013a58ab9f052cd2431e5e786 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 22 Aug 2006 03:11:24 +0000 Subject: [PATCH] Get rid of blank line at bottom of message log. --- macosx/MessageWindowController.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/macosx/MessageWindowController.m b/macosx/MessageWindowController.m index 7bbdd4e72..c38881962 100644 --- a/macosx/MessageWindowController.m +++ b/macosx/MessageWindowController.m @@ -86,6 +86,11 @@ NSCalendarDate * dateString; for (currentMessage = messages; currentMessage != NULL; currentMessage = currentMessage->next) { + //new line if text view is not empty + if (currentMessage != messages || ![[fTextView string] isEqualToString: @""]) + [[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc] + initWithString: @"\n"] autorelease]]; + int level = currentMessage->level; if (level == TR_MSG_ERR) levelString = @"ERR"; @@ -98,7 +103,7 @@ dateString = [[NSDate dateWithTimeIntervalSince1970: currentMessage->when] dateWithCalendarFormat: @"%Y-%m-%d %H:%M:%S" timeZone: nil]; - messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s\n", + messageString = [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%@ %@ %s", dateString, levelString, currentMessage->message]] autorelease]; [[fTextView textStorage] appendAttributedString: messageString];