From 49e7405fdcb713490e26521ffdda7e4e07c0259f Mon Sep 17 00:00:00 2001 From: Mark Jerde Date: Sat, 16 May 2015 09:44:53 -0500 Subject: [PATCH] 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. --- UI/BezelWindow.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UI/BezelWindow.m b/UI/BezelWindow.m index b745dab..c902334 100755 --- a/UI/BezelWindow.m +++ b/UI/BezelWindow.m @@ -102,6 +102,10 @@ static const float lineHeight = 16; - (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]; [bezelText release]; bezelText = newText;