At WWDC 2013, it has been noted several times that the Text Kit will simplify best practices such as text addition. But no code sample was offered for this session (220), and repeated searches for how to do this were mostly fruitless.
What I would like to do is click on a tab in the title bar (Markdown or Org-Mode style) and add all the text to the next title bar.
I can intercept the "insertTab" call with a subclass of NSTextView, and then use a regular expression to check if there was a tab in the title bar. If so, I use another regex to determine the range to the next header line. But what methods (I guess on NSLayoutManager - or NSTypeSetter or NSGlyphGenerator) do I call to collapse?
source
share