[Adium-devl] Auto alignment of message input field

Ofri Wolfus ofri.wolfus at gmail.com
Sat Jan 12 22:00:46 UTC 2008


On 10/01/2008, at 02:17, Peter Hosey wrote:

> On 2008-01-09, at 14:41, Ofri Wolfus wrote:
>> … the entire string is being sent a -baseWritingDirection which is
>> quite cheap in most cases.
>
> How cheap is -[NSTextStorage string]? Keeping in mind that, IIRC,
> insertText: gets called with nearly every keypress when the text view
> is active.

NSTextStorage is an NSAttributedString subclass, and the docs of - 
[NSAttributedString string] says the following: "For performance  
reasons, this method returns the current backing store of the  
attributed string object. ... This primitive method must guarantee  
efficient access to an attributed string’s characters; subclasses  
should implement it to execute in O(1) time."
So I believe it's fast enough. I haven't seen any performance change  
on my macbook.

>> This is needed in order to handle the case where a use types
>> something, deletes everything, and then types again in a different
>> language, or when moving the typing marker to the beginning and
>> inserting new text there.
>
> Is it broken currently? If so, is there a ticket?

What is broken? This is a new feature, not a bug fix.



More information about the devel mailing list