Hello, I'm trying to change the way the cursor is displayed, which is currently a vertical bar. I'd like it to be displayed as a block (more visible). I've seen on some forums that you need to modify the "filetypes.common" file and add a "true" option for "caret".
The two available options are as follows: #~ caret=caret #~ caret=0x000000;0x000000;false;
I've tried every possible modification, but the cursor remains unchanged.
Any idea how to solve this little problem?
Thanks in advance Pascal
You want to set the `caret` style, thats right, and the comment above it says what to set.
But did you remove the `#` which makes it a comment, so whatever you did to the setting was ignored. Also remove the `~` and space which made the "toggle comment" command work, but nobody realises that, so it just confuses everyone.
The git head has, or is about to get, an improvement on this commenting thing that hopefully will make it less confusing.
Hello and thank you for your reply. I've barely finished asking my question and I already have an answer!!!!
Which line am I supposed to modify? `#~ caret=caret` or `#~ caret=0x000000;0x000000;false;`
So whichever line I choose, it will become: `caret=caret;;true` or `caret=0x000000;0x000000;true;`
**??**
And just to make sure I'm doing it right, I modify the file from `"tools, configuration files, filetypes.common"`?
Thanks again
Which line am I supposed to modify? #~ caret=caret or #~ caret=0x000000;0x000000;false;
Ahh, but those are in separate sections, the first is in `[styling]` and the second is in `[named_styles]`. The first maps the lexical element, or in this case display element, to the named style set in the second one. But the named styles can be redefined in the colour schemes aka [themes](https://www.geany.org/download/themes/) picked by users, in place of the ones set in `filetypes.common`.
So whichever line I choose, it will become:
So edit the named style one.
I've barely finished asking my question and I already have an answer!!!!
You got lucky with the time zones, don't depend on it :smile:
I change the two but no change here is the modifications i made ``` caret=caret;;true caret=0x000000;0x000000;true; ```
![image](https://github.com/geany/geany/assets/8543044/4711c0ab-12bd-4ac2-86c4-b5aa43...)
As you can see, the cursor is always a vertical line
Thanks again
Don't touch the first one, I said edit the named style one, so put it back, and in fact comment it out again. The first is either a name, or a whole style, who knows what the mixture you made does :stuck_out_tongue_winking_eye:
For me just doing `Tools->Configuration Files->filetypes.common` set the `caret` setting in `[named_styles]` to the same as you (false->true, no comment) and save and the caret becomes the block immediately.
Hello, then in [styling] i let the default configuration : ``` .../... #~ caret=caret .../... ```
And i modify in [named_styles] ``` .../... caret=0x000000;0x000000;true; .../... ``` Without success
![image](https://github.com/geany/geany/assets/8543044/8f9081a4-c5ab-45f0-8da5-c5ba5a...) As you can see, the cursor is always a vertical line
Thanks for your help
Ahh, wait, you havn't said the version you are running, but probably its an olde version where the `[named_styles]` line is commented out too, remove the `#~` space.
I use Geany 1.38 I made as you told me (in the file filetypes.common) : ``` [named_styles] .../... caret=0x000000;0x000000;true;
``` All the other lines are "prefixed" with "#~".
But no more success
Thats weird, try starting Geany with `geany -c /tmp/foo` then `Tools->Configuration Files->filetypes.common` then just remove the `#~`space from the the `[named_styles]` line and the `caret=` line below it, then change the false on that line to true and save.
I totally forgot to mention that I use geany on windows. Maybe that's important
I totally forgot to mention that I use geany on windows. Maybe that's important
AFAIK only that `/tmp/foo` won't work :-D
Any location that exists (and you can write to) and a name that does __not__ exist should work, just remember you have to delete it manually after. The idea is to have Geany create a new user config to test with in case something else that has been changed is interfering.
I believe that block cursor works on Windows, but I might note that the Scintilla maintainer has pointed out in the past that it was a "drive by" contribution and isn't heavily used or maintained, so it might have issues.
Hello, The problem I'm experiencing is on my professional Windows PC. I'm currently running linux at home, so I tested geany under linux. The procedure you suggest seems to work with the default theme. If I change the theme, it no longer works.
I have absolutely no idea why it doesn't work on Windows, maybe Scintilla doesn't support block cursor there, although google couldn't find it anywhere in the [docs](https://www.scintilla.org/ScintillaDoc.html).
If I change the theme, it no longer works.
Yes, the `[named_styles]` section of filetypes.common is the default colour scheme. So if you change the colour scheme it will be replaced by your selection. If you look at colour scheme files you will find they have a replacement `[named_styles]` section.
The `[styling]` section in `filetypes.xxx` files map those named styles from the colour scheme to lexical entities for the language xxx. For `filetypes.common` the `[styling]` section maps non-language specific settings like caret, so you can edit the `caret=` in the `[styling]` section replacing the style name `caret` with the literal value from the `[named_styles]` section. Don't forget to uncomment it and the `[styling]` line.
Not sure ti understand what i have to do and what file i ve got to modify. You mean that i have to modify filetypes.common and the conf file of the theme ? (colorschemes/oblivion2.conf for example?)
It works !!!!!! **In filetypes.common** ``` [named_styles] .../... caret=0x000000;0x000000;true; ```
**In the theme configuration file** ``` [named_styles] .../... caret=#fff;#000;true;false ```
Unfortunately nobody has really written a "how to" for the styling system for the edit window works (you will notice I keep calling it "colour scheme" to avoid confusion with the GTK theme that applies outside the edit window). I can understand how it is confusing, I keep having to re-check it all the time too.
Its complicated because it has to do a complicated job, map styles to the many different lexical entities from all the 60+ programming languages Geany supports, but do it in a way that colour schemes can make changes when they are loaded. Its even more confusing because it has evolved over time, not been designed at once in a consistent way.
As I said before, there are some changes in the git version that make the editing process more consistent.
In any case, thank you for your help. Thanks to you, I managed to get what I wanted. Thanks again for your help.
Closed #3514 as completed.
github-comments@lists.geany.org