scoavoux / PandocTools

Sublime Text 3 package for pandoc markdown academic writing.
2 stars 0 forks source link

Folding #15

Open scoavoux opened 9 years ago

scoavoux commented 9 years ago

Allow line folding / unfolding at headings, like SmartMarkdown : https://github.com/demon386/SmartMarkdown/blob/master/smart_folding.py

XachaB commented 9 years ago

I believe that folding is already implemented in Sublime 3, as I have it natively with Python. I think it is a matter of modifying the syntax file, not writing a plugin.

See "foldingStartMarker" and "foldingStopMarker" syntax keys : https://sublimetext.userecho.com/topic/19281-syntax-code-folding/

scoavoux commented 9 years ago

it does seem to exist, though it does not appear in the new syntax documentation. However, the problem is recursion : SmartMarkdown allows nested foldings (where folding a level 1 heading folds every other foldable regions inside). I'm not sure this is possible with built-in folding : it will just fold the text up to the next title, but we want it to fold it to the next title of the same level.

XachaB commented 9 years ago

How about we wait for the syntax do-over, in case nested folding is then available. If not, we will need SmartMarkdown.