jamalsenouci / sublimetext-syntaxfold

Sublime Text Plugin that provides a configurable command and popup for folding code based on syntax
MIT License
40 stars 6 forks source link

Pattern regions #7

Closed ambs closed 9 years ago

ambs commented 9 years ago

Hello

Was trying to use syntaxfold for LaTeX but I am not sure if I am using it in the wrong way, or if it just doesn't work for what I want.

Basically, my config looks like:

        {
            "endMarker": "\\end{",
            "name": "LaTeX",
            "startMarker": "\\begin{"
        },

and as you might expect, marker lines continue with more characters up to the end of the line.

It seems it doesn't work with this kind of markers at the moment. I am right?

Also, does it have any problem with nested regions?

best,

ambs commented 9 years ago

This works:

    "endMarker": "\\\\end\\{",
    "startMarker": "\\\\begin\\{"

But that is not practical. But in other way, I wonder if I can use references... in order to say the begin{foo} needs to be closed by an end{foo}. That would be awesome, specially given currently proper nesting is not working.

ambs commented 9 years ago

Gah, it was a good try:

    "endMarker": "\\\\end\\{([^}]+)\\}",
    "startMarker": "\\\\begin\\{\\1\\}",

And, by the way, it would be great if the triangle indicator could appear automatically for the current region.

jamalsenouci commented 9 years ago

Sublime text should already support folding latex. Make sure the syntax is set to latex by going to view-->syntax and select latex. Then go to edit-->code folding and select fold all

— Sent from Mailbox

On Mon, May 11, 2015 at 8:00 PM, Alberto Simões notifications@github.com wrote:

Gah, it was a good try: "endMarker": "\end{([^}]+)}", "startMarker": "\begin{\1}",

And, by the way, it would be great if the triangle indicator could appear automatically for the current region.

Reply to this email directly or view it on GitHub: https://github.com/jamalsenouci/sublimetext-syntaxfold/issues/7#issuecomment-101017714