First things first: Thanks for reply. :)
> PHP folding on `{}` works for me.
>
> Not surprised C lexer does not work for PHP, its a different language.
Yes. Works for me too, and that's default. But the thing is that `[]` and `()`
are not working with default php lexer, and these should provide fold/unfold
markers within gutter as well.
PHP is C-style but is using HTML definitions for styling and keywords (which
is, to be sincere, nowadays - wrong), therefore, when I add
```
[settings]
lexer_filetype=C
tag_parser=C
```
.. or `python` instead of `C` - into ".config/geany/filedefsfiletypes.php" ..
fold/unfold markers do appear for all "pairs", but no color/syntax
highlighting.
When I modify `[keywords=html]` into `[keywords]` and place all php related
reserved words into `primary` .. colors are there .. but not `$variables` ..
and when I add `^$` as last `primary` (as **nothing else but primary works**)
.. I get the color for variables nicely, but it's the same color (expected,
"primary") as the rest of the PHP keywords.
On top of that .. with any other C or C-alike lexer that provides working fold
points for all "pairs" ( `{}`,`()` and `[]` ) .. shell style comments **are
not** reckognized, as well as line comments like this one `/// ... ` or block
comments like this one `/*: ... */`.
Standard `// ..` and `/* ... */` - do work.
So, to summarize .. when I modify original PHP lexer in order to enable fold
points just like for lets say .. Javascript files, the best I can get is one
color for all PHP related keywords (including `$variables`) and "limited"
coloring for comments.
If You have some spare time, simply open any php file with some populated
array/hashmap defined inside. You won't see folding point for that array.
Change to Javascript or C or D filetype, and You'll get folding points.
The thing is that PHP in Geany shares HTML lexer and it is very hard to "hack"
that in order to behave like it is supposed to. Arrays as well as function
parameters that span accross multiple lines. Those are very common thing in PHP
and scrolling or navigating via symbols is not that much elegant sometimes,
especially when particular source file is not tiny, but has 1000+ lines of
code.
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3561#issuecomment-1733016076
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/issues/3561/[email protected]>