Closed inventor96 closed 3 years ago
@inventor96 Hi, have you found a solution for your issue?
Unfortunately not yet.
By moving the comments and strings first, it should do the trick. Can you try:
"php": [
{
"begin": "/*",
"end": "*/",
"nested": false
},
{
"begin": "\"",
"end": "\"",
"nested": false
},
{
"beginRegex": "(?<!\\w)'",
"endRegex": "'",
"nested": false
},
{
"beginRegex": "(?:case|default)[^:]*:",
"endRegex": "break;|(.)(?=case|default|\\})",
"foldLastLine": [true, false]
},
{
"beginRegex": "{",
"middleRegex": "}[^}]+{",
"endRegex": "}\\s*(else|if)?",
"foldLastLine": [true, false]
},
{
"beginRegex": "if\\s*\\(.+\\)\\s*[^\\{]?",
"middleRegex": "else(?:\\s*if\\s*\\(.+\\)\\s*[^\\{]?)?",
"endRegex": ";"
},
{
"beginRegex": "<(?!area|base|br|col|embed|hr|img|input|link|menuitem|meta|param|source|track|wbr)([a-zA-Z]+)[^>]*[^>\\/]*>",
"endRegex": "<\\/\\1>"
},
{
"beginRegex": "<\\?(?:\\=|php)",
"endRegex": "\\?>"
},
{
"begin": "[",
"end": "]"
},
{
"begin": "(",
"end": ")"
}
]
That seems to have done the trick! Thanks @daiyam!
Describe the issue
I'm continuing to develop my PHP folding settings, and I've encountered another situation where the folding disappears for the given block as well as its parents. I'm not sure if it's something with my rules, or if it's too many matches too close together, or something else.
To reproduce
Code Example
Settings
Expected behavior
I would expect the fold markers to show for the
if
block and thefunction
block.Screenshots
I would expect folds for lines 8 and 9 in these first three screenshots
It appears that as long as I've removed the square brackets, the folds show up.
Additional context
The code in the third screenshot is invalid (hence the red underline), but I included it for demonstration purposes.