• 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: layoutManager:didCompleteLayoutForTextContainer:atEnd: and multi-column problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: layoutManager:didCompleteLayoutForTextContainer:atEnd: and multi-column problem


  • Subject: Re: layoutManager:didCompleteLayoutForTextContainer:atEnd: and multi-column problem
  • From: "Martin" <email@hidden>
  • Date: Mon, 03 Apr 2006 18:23:21 -0700

Hi Keith,

>2) If there are several columns of text and you select
>all, then hit delete, the text is deleted but the
>columns remain. This is a bug in TextEdit too

We got around this in our NSLayoutManager subclass. Specifically, in the "textStorage:edited:range:etc" method, we have some code that basically does this:

unsigned lim = [storage length];
if( range.location == lim ) {
    if( 0 == lim ) {
        NSTextContainer* tc = [[self firstTextView] textContainer];
        if( nil != tc ) [[self delegate] layoutManager:self didCompleteLayoutForTextContainer:tc atEnd:YES];
    }
    else {
        [self invalidateLayoutForCharacterRange:NSMakeRange(lim - 1, 1) isSoft:YES actualCharacterRange:NULL];
    }
}

Cheers,

~Martin

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Strange indexOfTabViewItemWithIdentifier behavior
  • Next by Date: Re: Path names in executable
  • Previous by thread: Generating my own key-value coding selectors
  • Next by thread: NSTextView and SDK path
  • Index(es):
    • Date
    • Thread