Skip navigation.
 
mlTyping attributes and the location of the insertion point
FROM : Todd Ransom
DATE : Mon Mar 03 17:24:29 2008

Hello,

I have an application that auto-formats documents as the user types 
according to certain industry standards. For instance, it might change 
the indent on the text or it might apply bold or italic formatting. I 
was doing this using a text storage subclass that would look up the 
appropriate attributes in a style table and return those attributes 
when asked. For various reasons I am re-designing this to use a 
conventional text storage class and delegate methods to apply the 
appropriate attributes to text as it is typed. When the user presses 
enter they will change styles. I do this by applying the attributes to 
the typing attributes for the text view.

This works well when the user is typing at the end of the text. When 
the user is typing in the middle of existing text, however, the ruler 
and insertion point do not always update to reflect the paragraph 
style of the typing attributes. Is this a bug? Or is this by design? I 
have tried using -[NSTextView updateRuler] to force the ruler to 
update but this has no effect. Is there any way to force the ruler and 
insertion point to update properly?

Todd Ransom
Return Self Software
http://returnself.com

Related mailsAuthorDate
mlTyping attributes and the location of the insertion point Todd Ransom Mar 3, 17:24
mlRe: Typing attributes and the location of the insertion point Douglas Davidson Mar 3, 18:08
mlRe: Typing attributes and the location of the insertion point Todd Ransom Mar 3, 18:25
mlRe: Typing attributes and the location of the insertion point Douglas Davidson Mar 3, 18:31
mlRe: Typing attributes and the location of the insertion point Todd Ransom Mar 3, 19:18