New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
color priority/precedence #3860
Comments
That's not how things work here, the identifier id either recognized as such anf given a separate style (which we might or might not draw the same as a string), or it's not recognized and thus is considered a string. Which language do you have issue with? |
Bash and PHP are mentioned. AFAICT bash needs property Php styles |
I use vim and it always color the identifier with a different color.
The problem occurs when you expect dollar variables to be colored by **identifier_1** (shell) and not **keyword** as it work in php. In my last post I explain why it happens.
If geany draws identifier_1 nicely out of the string and do not when the
dollar variable is interpolated in a string it is geany weakness and I am sure it can be fixed.
|
An important observation: For single quoted string 'Single quoted string kills $dollar $vars' it is OK as they kill dollar variables. In this case, the string color is used. But double quotes "Double quotation keeps the $dollar $variables" they should be colored as identifier_1 as geany does outside the string. |
PHP uses "preprocessor" color for the dollar variables, not identifier_1 ( that sh/bash use ) The question is: Why geany can draw php dollar variables interpolated in string correctly, but not for shellscript ? |
Try adding this in filetypes.sh (you can open it from Tools → Configuration files → Filetypes configuration files → Scripting languages): [lexer_properties]
lexer.bash.styling.inside.string=1
lexer.bash.styling.inside.backticks=1
lexer.bash.styling.inside.parameter=1
lexer.bash.styling.inside.heredoc=1 We probably should use all or some by default, we'd just need to check what defaults make more sense, and what the limitations might be. |
The bad news is that it doesn't work too. |
One question: what is the correct: altering via Geany Tools, ... or editing directly in the file /usr/share/geany/file... |
Have done that, opened via Tools, replaced all the file content with the configs you suggested and still not working. So we do have a bug here. |
if the software draws the string colors AFTER scalar and identifier_1 color, these colors are ovewritten by string color, and that seems to be the deep problem. |
WFM.
No it doesn't work like that. What version of Geany are you using? |
An identifier_1 (php/bash variables: $example) inside a string should be colored as identifier_1, not as string.
Probably it's related to the execution order applying the colors.
Now the string scheme has more importance than identifier, and it should be the opposite.
An example:
The ideal in this case I believe is firstly applying the string color, and then, applying the identifier color which would let the identifier with a different color even it is inside the string, the point is to call the attention to it.
In my editor, it is using the string color, ignoring the identifier color. Outside a string the identifier_1 color is OK, but when inside a string, the priority color used is the string color, not identifier_1's color.
The text was updated successfully, but these errors were encountered: