• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: disappearing NSSpellingStateAttributeName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: disappearing NSSpellingStateAttributeName


  • Subject: Re: disappearing NSSpellingStateAttributeName
  • From: Jesse Grosjean <email@hidden>
  • Date: Thu, 19 Jun 2008 07:28:54 -0400

Martin,

I haven't fixed it yet, but that seems likely to be the problem. Thank you!

Jesse

On Jun 18, 2008, at 5:41 PM, Martin Wierschin wrote:

Does anyone know what causes the _clearTemporaryAttributesForCharacterRange method to get called... and have theories on why it's being called in my app and why the NSSpellingStateAttributeName that it is clearing isn't being replaced?

I believe that method should only be called when the character contents of the text storage have changed, not the attributes. I would guess that your syntax coloring (or other attribute modifications) are making their changes within a bracketed edit (eg: while a beginEditing call hasn't been closed by a corresponding endEditing). Basically the edited range/flags are all unioned together so it would all appear as one giant text change to the layout manager. Imagine the call sequence:


NSTextStorage* ts = whatever;
[ts beginEditing];
[ts replaceCharactersInRange:NSMakeRange(0,0) withString:@"x"];
[ts addAttribute:NSWhateverAttributeName value:whatever range:NSMakeRange(0, [ts length])];
[ts endEditing];


When the layout manager is notified from processEditing the editedMask/editedRange will specify both characters and attributes have changed across the whole storage. Thus the layout manager would clear away temporary attributes for the entire storage.

~Martin


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >disappearing NSSpellingStateAttributeName (From: Jesse Grosjean <email@hidden>)
 >Re: disappearing NSSpellingStateAttributeName (From: Martin Wierschin <email@hidden>)

  • Prev by Date: Re: Send Key Event to Focused Window
  • Next by Date: NSViewContoller contained subviews not redrawing
  • Previous by thread: Re: disappearing NSSpellingStateAttributeName
  • Next by thread: Race condition with awakeFromNib?
  • Index(es):
    • Date
    • Thread