[TextMate] Folding in text with no stop marker

Andre Posumentov andre at alpdesignworks.com
Tue Oct 19 09:36:11 UTC 2004


Hi all,

I keep finding texts for which it seems impossible to define a stop 
marker for the folding.  These are block structures where the folding 
should strictly speaking stop - at the line before the one in which 
indentation returns to it's previous level.

That's clumsily expressed, but some examples include:

  - Cisco config files:

     line vty 0
         exec-timeout 0 0
         login local
         length 0
         width 134
     line vty 1 4
         exec-timeout 0 0
         password 7 1234
         login local
         length 0

- Python:

         def poll(self):
             if self.returncode == None:
                 if WaitForSingleObject(self._handle, 0) == 
WAIT_OBJECT_0:
                     self.returncode = GetExitCodeProcess(self._handle)
                     _active.remove(self)
             return self.returncode
         def doSomethingElse():
		return bah	

- Simple markup schemes such as Restructured Text, Markdown (?) etc.

Unless I've missed something (easily possible :), there doesn't seem to 
be any way of folding text of this sort.  I can't do it using regular 
expressions alone - and I imagine it will require a flag of some sort, 
or an editor variable (PreviousIndentLevel ??)  that can be defined as 
the "foldingStopMarker".

So, questions:

- Am I wrong? Does anyone know of a way to fold text of this sort?
- If not: is it possible that such functionality could be made 
available by the editor.  So that one can say "stop folding when the 
text returns to it's previous indent level".

Cheers,
-- Andre





More information about the textmate mailing list