Changeset 830


Ignore:
Timestamp:
Aug 24, 2006, 2:04:54 AM (17 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/MessageWindowController.m

    r829 r830  
    119119            unsigned int loc = [text rangeOfString: @"\n"].location;
    120120            if (loc != NSNotFound)
    121                 [fTextView setString: [[text substringFromIndex: loc + 1] stringByAppendingString: messageString]];
     121                [[fTextView textStorage] deleteCharactersInRange: NSMakeRange(0, loc + 1)];
    122122        }
    123123        else
    124         {
    125             [[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc] initWithString:
     124            fLines++;
     125       
     126        [[fTextView textStorage] appendAttributedString: [[[NSAttributedString alloc] initWithString:
    126127                                        messageString attributes: fAttributes] autorelease]];
    127             fLines++;
    128         }
    129128    }
    130129   
Note: See TracChangeset for help on using the changeset viewer.