godot icon indicating copy to clipboard operation
godot copied to clipboard

TextEdit cursor option for "caret_background_color" fails to activate

Open inhalt120g opened this issue 1 year ago • 4 comments

Tested versions

v4.2.1.stable.official [b09f793f5]

System information

Godot v4.2.1.stable - macOS 14.2.0 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)

Issue description

The setting for the caret fails to render. Mentioned here: https://github.com/godotengine/godot-proposals/issues/8473#issuecomment-1845930636

Steps to reproduce

In Editor Settings, find the background color setting for the caret. Change it to whatever, but it will have no effect. image

Minimal reproduction project (MRP)

Godot IDE

inhalt120g avatar Dec 18 '23 01:12 inhalt120g

Indeed, unlike caret_color, the caret_background_color is never used in text_edit.cpp

jsjtxietian avatar Dec 18 '23 03:12 jsjtxietian

In the linked issue @Paulb23 said:

caret_background_color should be the colour of the text behind the caret when block caret is enabled, but currently there's a bug where it's not actually used anywhere.

I assume "block caret" is when you hit the Ins key on your keyboard and the caret switches to something that underlines a letter at a time.

Can I confirm that this setting is meant to change the colour of the text character that the cursor and not the background of the selected letter?

To put it another way, Option 1 or 2?

image

TheSofox avatar Sep 21 '24 19:09 TheSofox

I assume "block caret" is when you hit the Ins key on your keyboard and the caret switches to something that underlines a letter at a time.

I was not able to test this since Macs don't use Insert key (there are ways to add it but it's not a 1:1 mapping as on Windows. Related discussion link). But I don't think it's relevant here.

Can I confirm that this setting is meant to change the colour of the text character that the cursor and not the background of the selected letter? To put it another way, Option 1 or 2?

The name of the option is "Caret background color", so it looks like option 2.

inhalt120g avatar Sep 22 '24 08:09 inhalt120g

The name of the option is "Caret background color", so it looks like option 2.

You see, that's exactly what I was thinking, it makes sense.

But check the documentation: https://docs.godotengine.org/en/stable/classes/class_textedit.html#class-textedit-theme-color-caret-background-color

Color of the text behind the caret when using a block caret.

This seems to imply Option 1.

Meanwhile within the editor. 284141749-c22d414a-af72-4ed7-8cf9-6ede02e864d8

The script editor's caret background color. seems to imply Option 2.

I don't know who's decisions it is, but I would appreciate if it could be officially clarified which Option to go for.

TheSofox avatar Sep 22 '24 17:09 TheSofox