Sorry if this is FAQ, but can you please point me to where I should go?
I'm using TextMate version 2.0-alpha.9561, but this issue persists for more than a year and Googling didn't give me any resolution yet.
Simply, it doesn't fold/unfold for YAML file. In 'Edit Bundles', 'Settings' doesn't include 'Folding' while other bundles such as XML does. I guess foldingStopMarker might be wrong, but don't know if it's really used since it doesn't show up in 'Edit Budles / Settings'.
Thanks in advance, Toru
On 19 Sep 2014, at 23:08, Toru Mori wrote:
Simply, it doesn't fold/unfold for YAML file. In 'Edit Bundles', 'Settings' doesn't include 'Folding' while other bundles such as XML does. I guess foldingStopMarker might be wrong, but don't know if it's really used since it doesn't show up in 'Edit Budles / Settings'.
The TextMate 1.x folding system requires an explicit start and stop marker for foldings. The system is documented here: http://manual.macromates.com/en/navigation_overview#customizing_foldings
I believe that YAML is based entirely on indent, so this system cannot work with YAML.
In TextMate 2.0 an indented folding system was introduced, this is used for foldings in Python, Markdown headings, and C++ accessor keywords, not sure if it’s used elsewhere.
It is mentioned in the “Fold on the Dotted Line” section here http://blog.macromates.com/2012/the-layout-engine/
If you can come up with a pattern to use for foldingIndentedBlockStart then we’ll gladly add it to the YAML bundle.
Allan Odgaard-4 wrote
On 19 Sep 2014, at 23:08, Toru Mori wrote:
Simply, it doesn't fold/unfold for YAML file. In 'Edit Bundles', 'Settings' doesn't include 'Folding' while other bundles such as XML does. I guess foldingStopMarker might be wrong, but don't know if it's really used since it doesn't show up in 'Edit Budles / Settings'.
The TextMate 1.x folding system requires an explicit start and stop marker for foldings. The system is documented here: http://manual.macromates.com/en/navigation_overview#customizing_foldings
I believe that YAML is based entirely on indent, so this system cannot work with YAML.
In TextMate 2.0 an indented folding system was introduced, this is used for foldings in Python, Markdown headings, and C++ accessor keywords, not sure if it’s used elsewhere.
It is mentioned in the “Fold on the Dotted Line” section here http://blog.macromates.com/2012/the-layout-engine/
If you can come up with a pattern to use for foldingIndentedBlockStart then we’ll gladly add it to the YAML bundle.
textmate mailing list
textmate@.macromates
Hi Allan and Toru,
could it be that the current system for matching the end marker of foldings has problems with matching “empty” lines? The folding marker used in the YAML bundle seems to work fine in TextMate 1 but not in TextMate 2. I attached two screenshots showing the different behaviour.
http://textmate.1073791.n5.nabble.com/file/n28270/YAML_TextMate_1.png http://textmate.1073791.n5.nabble.com/file/n28270/YAML_TextMate_2.png
Implementing the TextMate 1 behaviour inside TextMate 2 might fix the problem described by Toru.
Kind regards, René
-- View this message in context: http://textmate.1073791.n5.nabble.com/YAML-bundle-doesn-t-work-for-fold-unfo... Sent from the textmate users mailing list archive at Nabble.com.
On 23 Sep 2014, at 11:19, sanssecours wrote:
could it be that the current system for matching the end marker of foldings has problems with matching “empty” lines? The folding marker used in the YAML bundle seems to work fine in TextMate 1 but not in TextMate 2 […]
Looking at the code, I am not sure why empty lines are not allowed to be folding stop markers (in 2.0) so I changed this in latest nightly build (alpha 9571) which makes the YAML bundle offer foldings with the default patterns.
It probably still would be good to “update” the folding settings to use the new indent-based folding system, as that should be more robust.