In PHP there are two coding styles when it comes to if..else blocks; in the first one (that can be called official, as of https://github.com/php-fig/per-coding-s ... er/spec.md), elseif doesn't get its code folding trigger:
Small inconsistency in code folding (PHP)
Small inconsistency in code folding (PHP)
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Small inconsistency in code folding (PHP)
As far as I can tell - the coding style guide doesn't contain any advice on how code editors should handle folding
It does say however that "elseif" should be used instead of "else if". But that shouldn't affect folding...

- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Small inconsistency in code folding (PHP)
Btw. this is what it looks like at my end.
I assume this is how it should look? Isn't it?
I assume this is how it should look? Isn't it?
Re: Small inconsistency in code folding (PHP)
Yes it is: same folding regions in both sample if..else blocks, unlike at my end.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Small inconsistency in code folding (PHP)
Are you still using your own custom syntax file? If so - try to update the fold section.
Re: Small inconsistency in code folding (PHP)
I've never used custom PHP syntax file
Right now I notice problems with folding if..else branches only during adding them and they usually go away (= fold icon appears on the gutter) after adding newline (hitting Enter key) someplace.

Right now I notice problems with folding if..else branches only during adding them and they usually go away (= fold icon appears on the gutter) after adding newline (hitting Enter key) someplace.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus