From 3c1132d4cfebf5891afbe98fdff667d6bcf0f3e5 Mon Sep 17 00:00:00 2001 From: avenjamin Date: Wed, 26 Nov 2008 04:18:52 +0000 Subject: Tiny clean up. --- TableDocument.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TableDocument.m b/TableDocument.m index f473dfd2..785907f1 100644 --- a/TableDocument.m +++ b/TableDocument.m @@ -545,8 +545,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa */ - (void)toggleConsole:(id)sender { - NSDrawerState state = [consoleDrawer state]; - if (NSDrawerOpeningState == state || NSDrawerOpenState == state) { + if ([self consoleIsOpened]) { [consoleDrawer close]; } else { [consoleTextView scrollRangeToVisible:[consoleTextView selectedRange]]; @@ -582,6 +581,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa [consoleTextView replaceCharactersInRange:NSMakeRange(begin,0) withString:message]; end = [[consoleTextView string] length]; [consoleTextView setTextColor:[NSColor blackColor] range:NSMakeRange(begin,end-begin)]; + if ([self consoleIsOpened]) { [consoleTextView displayIfNeeded]; [consoleTextView scrollRangeToVisible:[consoleTextView selectedRange]]; @@ -600,6 +600,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa [consoleTextView replaceCharactersInRange:NSMakeRange(begin,0) withString:error]; end = [[consoleTextView string] length]; [consoleTextView setTextColor:[NSColor redColor] range:NSMakeRange(begin,end-begin)]; + if ([self consoleIsOpened]) { [consoleTextView displayIfNeeded]; [consoleTextView scrollRangeToVisible:[consoleTextView selectedRange]]; -- cgit v1.2.3