Skip navigation.
 
mlRe: Typing attributes and the location of the insertion point
FROM : Todd Ransom
DATE : Mon Mar 03 18:25:57 2008

I do ensure that paragraph styles are consistent throughout the 
paragraph. New styles are applied in insertNewlineForTextView: or, if 
the user changes them manually, they always cover the range of the 
entire paragraph. What I am seeing is that when the user is typing in 
the middle of text and I change the style after a newline, sometimes 
the text indent does not update until the user types a character, at 
which point the ruler and insertion point update to the correct 
position. The indent seems to update find if it is larger than the 
previous indent but not when it is smaller.

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



On Mar 3, 2008, at 12:08 PM, Douglas Davidson wrote:

>
> On Mar 3, 2008, at 8:24 AM, Todd Ransom wrote:
>

>> 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?

>
> I can't tell exactly what's going on without seeing it, but one 
> thing you need to keep in mind is that paragraph styles need to be 
> constant over the whole range of the paragraph; if they aren't, then 
> paragraph style fixing will make sure they are by extending the 
> paragraph style from the beginning of a paragraph to cover all of 
> it.  If the user is typing in the middle of a paragraph, just 
> changing the paragraph style in the typing attributes wouldn't be 
> enough; you would need to change it for the whole paragraph in the 
> text storage.
>
> Douglas Davidson
>

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