Bezel performance suffers when the copy length gets very large (I frequently copy >1,000,000 characters), so limit the amount given to the Bezel to something closer to the actual Bezel display capacity. Bezel performance is great, the paste still has it all, and the Bezel still has more than it has room to display.

This commit is contained in:
Mark Jerde 2015-05-16 09:44:53 -05:00
parent ae0011d388
commit 49e7405fdc

View file

@ -102,6 +102,10 @@ static const float lineHeight = 16;
- (void)setText:(NSString *)newText - (void)setText:(NSString *)newText
{ {
// The Bezel gets slow when newText is huge. Probably the retain.
// Since we can't see that much of it anyway, trim to 2000 characters.
if ([newText length] > 2000)
newText = [newText substringToIndex:2000];
[newText retain]; [newText retain];
[bezelText release]; [bezelText release];
bezelText = newText; bezelText = newText;