Fold line syntax

The beginning line of a fold must have the following syntax: the first three characters are arbitrary and are followed by a `number sign' (#) as the 4-th character and an opening square bracket ([) as the fifth. After this comes the label, which may consist of any characters with the exception of carriage returns, linefeeds and colons. A colon (:) is used to terminate the label field and must be present! After the colon, arbitrary characters are allowed as in normal text. The ending line should look exactly the same as the beginning line in the range between the number sign (#) and the colon (:) that terminates the name field except that the fifth character ([) should be replaced by a closing square bracket(]). The characters outside this field (the first three or those following the colon) need not be the same. When a fold has been closed the line that represents it is a copy of the opening fold line (or beginning fold line) but it has a second `number sign' where the opening fold line has its square bracket. The closed fold line may not be changed under any condition. If you don't like it you have to open the fold first and change at least the opening fold line.

With this syntax, the first three characters can be used to set off the line as commentary for a compiler, and the characters after the colon can be used as commentary for the programmer. Note also that tabs count as single characters so that when used in the first three characters of the line, a measure of indentation can be achieved.

Folds may be nested to any depth. The only restriction lies in a potential stack overflow, because some operations for nested folds work via a recursion. Typically at least 50 levels should be possible. Beyond that the reaction of stedi may depend on the computer on which it runs. If the stack is not protected agains overflow a crash may result. In practice the user will rarely go beyond 4 or 5 levels.