#875 php_hstring dont work for highlighting PHP doublequotes stri

closed-works-for-me
nobody
None
5
2014-01-29
2012-07-28
Alex Chechel
No

Lost opportunity to highlight the different colors of single and double quotes strings in PHP code. If I install geany-0.21-2 it's works good but in version 1.22 all strings are highlighted in one color.
It is very important for me because I need to know what the type of line I see when i need separating string or insert quote in the SQL query.
I'm sorry if the problem is solved but I have not found the solution and am sorry for my English.

Discussion

  • Alex Chechel
    Alex Chechel
    2012-07-28

    example

     
    Attachments
  • Matthew Brush
    Matthew Brush
    2012-07-28

    You can tweak the colors used by changing the mapping in filetypes.html (that's where PHP highlighting stuff is, don't ask why). You could either put some style right there in the filetypes.html file or change it to say string_2, string_3, or string_4 and then change the style for string_2, string_3, or string_4 in your color scheme (recommended). If you're using the default color scheme, it is inside the file filetypes.common (that's where the default color scheme is, don't ask why) under [named_styles]. There is some info in the manual also, but once you look around in those files it should make some sense (hopefully).

     
  • Alex Chechel
    Alex Chechel
    2012-07-28

    Thank you! I figured, although it is not logical.
    It is strange that a change in the default theme has led to the similar color of strings of various types.
    Earlier I was trying to insert php_hstring into filetypes.php and filetypes.xml but it not lead to anything

     
  • Alex Chechel
    Alex Chechel
    2012-07-29

    • status: open --> closed-works-for-me
     
  • chris kelley
    chris kelley
    2014-01-29

    I've got a fresh install on Windows 7 and the php strings are not handled properly. All are green. The version from ubuntu had single quote strings as orange and double quotes as green.

     
  • @cacycleworks read Matthew's answer, this is only a change in how things are mapped by default but you can change it. Even a theme can change it by having different colors for string_1 and string_2

    The rationale for this is that now we properly support themes, so for each language we just map token type to a style name, and the theme decides how to style that name. This allows to properly support themes, but also changes a bit the default look of many file types, because it's now unified.

    But again, just change your theme to use a different color for string_2, or hardcode the color directly in filetypes.html.

     
  • chris kelley
    chris kelley
    2014-01-29

    This was an all-stock install. As delivered it doesn't work. Further, there is no "filetypes.html". Maybe you mean \Users\me\AppData\Roaming\geany\fieldefs\filetypes.common ?

    Yes, setting string_2 there did not help Geany handle php strings. I then google'd hoping for a fix and found this "bug" where it seems the answer to this is to make my own template or style.

    It would be fantastic if someone who knew how Geany works (ie, the people maintaining the code) could make php highlighting work as delivered. Or perhaps add a work-around to the wiki?

     
    Last edit: chris kelley 2014-01-29