bsegraves / custom-folds

Atom plugin for defining custom markers for foldable regions.
MIT License
24 stars 9 forks source link

Code folding not working in LaTeX #20

Closed quantumgolem closed 7 years ago

quantumgolem commented 7 years ago

I was searching for something that would allow me to easily fold code in LaTeX documents, and I found this which seemed like it could help. I tried to use it, but it doesn't seem to work.

What I'm trying to do is to fold everything between a \begin{something} and an \end{something}. I tried adding it in the settings, in "beginning/end of foldable region pair" (for the beginning I put \begin{something} and for the end I put \end{something}. What happens is that after adding it, I see a fold button in the gutter, but when I click on it nothing happens. I tried restarting Atom editor, but after doing that that button disappeared completely.

Is this the correct way to do this, or am I doing it incorrectly? It this even the correct package to achieve this? I was just looking for a package which would help me, and this seemed to be the package which could help me.

FlorianWendelborn commented 7 years ago

This package only parses comments for folding blocks. So you'd have to do something similar to this:

% region something
...
% endregion
quantumgolem commented 7 years ago

Ah, I see. That makes sense. Is there any Atom package that allows customized code folding? I've been search for a while but this package is the only one it seems that actually does something similar to it, though I'd still like custom code folding functionality (because there's no support for LaTeX, it seems). Otherwise I could definitely use this, though it seems like doing so would be a bit more work...

I really do feel like custom code folding should be a thing, somewhere... it seems like to big a thing to leave out...

quantumgolem commented 7 years ago

Well, maybe I'll find something. If anyone has suggestions, feel free to share them!

FlorianWendelborn commented 7 years ago

@sn0wyfall You can always fork this repo or submit a pull request though.

quantumgolem commented 7 years ago

Thanks for the suggestion. I could do this but unfortunately I don't know anything about coding, so I don't think it would be easy. I was looking at this package which seems to enable markdown folding for markdown headers, so I was thinking of forking that and then messing around with it, but honestly after looking at the lib file, maybe I'll just skip it. Thanks again for trying to help.