You need to modify lexilla's code, to get the () and [] code folding support 
for PHP:
geany-2.0/scintilla/lexilla/lexers/LexHTML.cxx
`case eScriptPHP:
        if (
                (state != SCE_HPHP_COMMENT) && 
                (state != SCE_HPHP_COMMENTLINE) && 
                (state != SCE_HJ_COMMENT) && 
                (state != SCE_HJ_COMMENTLINE) && 
                (state != SCE_HJ_COMMENTDOC) && 
                (!isStringState(state))
        ) {
                if (ch == '#') {
                        Sci_Position j = i + 1;
                        while ((j < lengthDoc) && 
IsASpaceOrTab(styler.SafeGetCharAt(j))) {
                                j++;
                        }
                        if (styler.Match(j, "region") || styler.Match(j, "if")) 
{
                                levelCurrent++;
                        } else if (styler.Match(j, "end")) {
                                levelCurrent--;
                        }
                }
                // Modify here
                //else if ((ch == '{') || (ch == '}') || (foldComment && (ch == 
'/') && (chNext == '*'))) {
                        //levelCurrent += (((ch == '{') || (ch == '/')) ? 1 : 
-1);
                //}
                else if ((ch == '{') || (ch == '}') || (ch == '[') || (ch == 
']') || (ch == '(') || (ch == ')') || (foldComment && (ch == '/') && (chNext == 
'*'))) {
                        levelCurrent += (((ch == '{') || (ch == '[') || (ch == 
'(') || (ch == '/')) ? 1 : -1);
                }
        } 
        else if (((state == SCE_HPHP_COMMENT) || (state == SCE_HJ_COMMENT || 
state == SCE_HJ_COMMENTDOC)) && foldComment && (ch == '*') && (chNext == '/')) {
                levelCurrent--;
        }
        break;`

So I think you should get a feedback to Scintilla project.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3561#issuecomment-2130729416
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/3561/[email protected]>

Reply via email to