Geany 2.0, running on MacOS 12.7.3
In my colorscheme file I have
`selection=000;#F00;false;true`
In filetypes.common, I have
`selection=0x000000;0x001332;false;true`
but Geany is still using the default colour when selecting text with the mouse.
Seems to work here:
<img width="553" alt="Screenshot 2024-11-23 at 19 15 23" src="https://github.com/user-attachments/assets/e58bb000-fc13-4520-9b6c-59847c5cbc99">
Just a guess - do you have the [styling] section above uncommented? (Some older Geany versions kept it commented-out and then the config option doesn't work)
I don't have any _styling_ section. I got my style file by coping one which came with geany and modified it (tinge.conf). This file has at the start the section ```[theme_info]``` and then a section ```[named-styles]```. My **selection** setting is in this **named-styles** section. There are no other sections in this file.
It isn't completely clear what you are trying to achieve - do you want to use the selection color from `filetypes.common` or the color defined in your theme? If you want to use the color from the color theme, comment-out `selection=0x000000;0x001332;false;true` in `filetypes.common`.
To put it shortly, the current selection colour makes some styles hard to read. Instead of modifying the - otherwise well done - style sheet, I wanted to modify the selection colour.
My first approach was changing the **selection** settings in filetypes.common, but this did not have any effect.
After some researching, I found a hint that the selection settings in the theme file take precedence (which makes sense to me), so I put them there as well. I made shure (for testing only) that the selection settings in the theme file are very different from the settings in filetypes.common, so that I can see which ones will effectively apply. However it seems that both are ignored.
My first approach was changing the selection settings in filetypes.common, but this did not have any effect.
This should work - it worked for me in the example above and it should override the theme's selection color. So my guess is that there's some syntax error in your `filetypes.common` and as a result of it the file isn't read.
I'd suggest that you try the following: 1. Close Geany 2. `mv ~/.config/geany/filedefs/filetypes.common ~/.config/geany/filedefs/filetypes.common.backup` (i.e. remove your `filetypes.common` and save it under a different filename as a backup) 3. Open Geany, open Tools->Configuration Files->filetypes.common - this should open the Geany's default version of the file 4. Place `selection=000;#F00;false;true` under the `[styling]` section
I have created a gist with the two files, so that you can see exactly what's in them:
https://gist.github.com/rovf/3f281b87baf852c83ec9ee1ca6f79e44
So: 1. If you want to override any theme settings, set the `selection` value here https://gist.github.com/rovf/3f281b87baf852c83ec9ee1ca6f79e44#file-filetypes... 2. The value here https://gist.github.com/rovf/3f281b87baf852c83ec9ee1ca6f79e44#file-filetypes... only affects the theme named "Default" 3. The `tinge.conf` file is correct and the `selection` value should be used and it works for me. Now the question is why it doesn't work for you - do you have this file stored under `~/.config/geany/colorschemes`? Note that this theme is distributed with the macOS binary so you possibly still see this theme from the installation directory but not the version modified by you if you stored it under a wrong location.
First of all, filetypes.common is syntactically correct, because it reflects my other changes I made there (for instance, making the cursor wider).
But I found that restarting Geany helped, and I can now see the changes.
My guess is that Geany does not monitor the theme file and one needs to reload it somehow. Indeed I could verify this:
Now that I can see that the settings basically do take effect, I now changed the value again from the one I used for debugging (plain red) to a more suitable light yellow. Again after I saved the theme file, the old (red) value still was persistent, but once I switch in Geany to a different theme and back to _tinge_, I can see that the changes work.
BTW, as for the two gist links you posted (L10 and L111): They are identical, i.e. while the gist link is different, the text in the two is the same (I used a compare tool to make sure that I don't miss any difference).
My guess is that Geany does not monitor the theme file and one needs to reload it somehow.
That's true. But `filetypes.common` is monitored and if you edited line 10 as suggested, you would get the change immediately.
BTW, as for the two gist links you posted (L10 and L111): They are identical, i.e. while the gist link is different, the text in the two is the same (I used a compare tool to make sure that I don't miss any difference).
They are identical - they are yours ;-)
I just emphasized the line number which you should edit - you edited line number 111 which corresponds to the default theme and this won't work for the theme you use. Instead, you should have edited line 10.
Closed #4064 as completed.
I edited them differently (I was not aware, that this mattered):
Geany allows that filetypes.common can be opened via the menu, so I edited it from inside Geany.
As for the theme file, Geany does not offer this ability, so I went on the command line to my configuration directory and used the nano editor to edit that file.
Geany allows that filetypes.common can be opened via the menu, so I edited it from inside Geany.
This is correct and Geany reloads the file automatically when saved. No problem here. Your problem was that you edited the incorrect line (line 111) and not line 10 from your gist.
As for the theme file, Geany does not offer this ability, so I went on the command line to my configuration directory and used the nano editor to edit that file.
Well, you can't open the theme from GUI but you could set up Geany so it can be started from the command line too by adding something like this to your `.zprofile` (if you use zsh as your shell): ``` alias geany=/Applications/Geany.app/Contents/MacOS/geany ```
github-comments@lists.geany.org