Re: code folding in NSTextView

2010-03-24 Thread Gerriet M. Denkmann
On 25 Mar 2010, at 00:02, Martin Hewitson wrote: > I guess this is an old chestnut, but a google search didn't reveal any good > clues as how one might go about doing code folding in an NSTextView subclass. > > So, does anyone have any suggestions how one might implement such a feature? > Th

Re: code folding in NSTextView

2010-03-24 Thread Martin Hewitson
Hi Kyle, I already have the model objects being backed by individual NSTextContainers which then adopt the text view when they need to (using setTextView:). I was just wondering if there are any recommendations how to conceptually handle code folding, especially as I have line numbering. So, sh

Re: code folding in NSTextView

2010-03-24 Thread Kyle Sluder
On Wed, Mar 24, 2010 at 10:18 AM, Jon Pugh wrote: > I would consider trying to use an NSOutlineView instead.  You'd have to > identify lines which could be folded, in order to make them collapsible, but > I think it has the basics of what you need. NSOutlineView does not a good text editor make

Re: code folding in NSTextView

2010-03-24 Thread Jon Pugh
At 5:46 PM +0100 3/24/10, Martin Hewitson wrote: >I guess this is an old chestnut, but a google search didn't reveal any good >clues as how one might go about doing code folding in an NSTextView subclass. I would consider trying to use an NSOutlineView instead. You'd have to identify lines whic

Re: code folding in NSTextView

2010-03-24 Thread Kyle Sluder
On Mar 24, 2010, at 9:46 AM, Martin Hewitson wrote: So, does anyone have any suggestions how one might implement such a feature? This is for a LaTeX editor so I'm interested in folding blocks of code between, for example, \begin{} \end{} tags, collapsing \section, \subsection, etc. The