mattiasnordin / StataEditor

Stata Editor for Sublime Text 3
47 stars 18 forks source link

Code folding #19

Open acarril opened 7 years ago

acarril commented 7 years ago

First of all, thank you @mattiasnordin ! StataEditor works like a charm for me. This is a feature request, not a bug report. Stata Editor in ST3 is in many ways superior to Stata's own do-file editor.

However, one feature I miss very much is code folding. I don't know anything on writing ST plugins, but I guess it should be fairly easy to implement, given that Stata's use of curly braces to mark sections of code is fairly standard.

Many thanks

mattiasnordin commented 7 years ago

Thanks for the suggestion, I'll think about whether to include it in a future update. There is a simple way to do it already (as you may aldready know) by simply using indentation, as that is recognized by Sublime Text. I think it also helps making the code readable.

richard-herron commented 6 years ago

FWIW, you can use another package to fold code. I use the SyntaxFold package on Package Control.

Here is my SyntaxFold settings file.

{
    "config":[
        {
            "scope": "source.stata",
            "startMarker": "{{{",
            "endMarker": "}}}"
        },
        {
            "scope": "text.tex.latex",
            "startMarker": "\\(fold\\)",
            "endMarker": "\\(end\\)"
        }
    ]
}