Closed artfulrobot closed 9 years ago
Ah, no, I've broken it! Closing PR until it's fixed.
Ah, no, I've broken it! Closing PR until it's fixed.
Keep in mind, I have been noticing some bugs related to closures as method arguments and if statements inside switches. I just haven't had time lately to investigate the causes and try to fix them.
OK, this is what I'm trying now.
Once you add setting the default option for b:phpfold_curlies
, I'll take a closer look at this tonight and merge if I don't find any other problems.
So, it looks like this breaks a couple of situations.
b:phpfold_curlies = 0
prevents correct folding of
function foo(
$arg1,
$arg2
) {
// do things!
}
Lines 1-4 of that end up folded while the function body is unfolded.
b:phpfold_brackets = 0
seems to break when there's a closure passed as an argument to a function call:
foobar(
function ($arg) {
// closure things!
},
'arg2'
);
At function ($arg)
the fold level is increased by 2, but is only decreased by one at the end of the closure. This causes everything after the closure up to the next line that sets a hard fold-level (rather than decreasing by a relative amount) to be included in the fold.
Yes, I've come to the same conclusion. Closing for now.
Fixes https://github.com/swekaj/php-foldexpr.vim/issues/17