I use a lot of HEREDOC statements in my PHP and noticed that this seems to severely get in the way of code folding in Sublime. E.g. try folding the example function, or the “then” portion of the if statement in this code to see what I mean:
<?php
function example($a)
{
if (1)
{
echo $a;
$str = <<<HEREDOC
line1
line2
HEREDOC;
echo $a;
}
else
{
echo $a;
echo $a;
}
}
In reading this recent post (https://forum.sublimetext.com/t/confused-code-folding/7899/2), it sounds like the folding logic is based on indent levels, which certainly doesn’t work with PHP’s HEREDOC requirement of having the ending marker in column 1. See http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc.
Are there any workarounds in Sublime for this? Am I doing something wrong here?