Hi Grant,
Is there a way to fold code to a specified level with one mouse click or keyboard function?
There is no function or feature in Zeus that does this, but it should be fairly easy to implement as a Zeus script
The
pseudo code for the macro script would be something like the following:
Code: Select all
Save the current cursor details
Get the text for the current line
Calculate the whitespace indent level for the current line
For all the lines in the current document
If line has the same indent level
Move the cursor to this line
Call the FoldingLineClose or FoldingLineOpen function to open/close the fold
End If
End for
Restore the saved cursor details
NOTE: The
FoldingLineClose and
FoldingLineOpen are keyboard function that open and close the folds for the current line.
For more information on how to write such a script refer to the Zeus help and search for the
Builtin Functions topic in the index.
Also there are lots of scripting examples in the
zScript folder
Cheers Jussi