Skip to content
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

Selected word's duplicates highlight is very hard to see #77812

Closed
blackears opened this issue Jun 3, 2023 · 5 comments
Closed

Selected word's duplicates highlight is very hard to see #77812

blackears opened this issue Jun 3, 2023 · 5 comments

Comments

@blackears
Copy link

Godot version

v4.0.2.stable.official [7a0977c]

System information

Windows 10, Compatability

Issue description

I think it would be a good idea to change the default settings for how the highlighting for duplicates of the selected word is handled by the editor. In the current editor, this setting is so close to the default background that it is nearly invisible. (See the second occurrence of to_plane in the attached image).

Being able to highlight a particular word and then scrolling through your code to find any duplicates is a very helpful thing to do when debugging and it's not practical to do with the current default settings.

image

Steps to reproduce

Create a new script file.
Write some code where the same variable is used on more than one line.
Double click on one instance of the variable name to highlight it.
Observe the color of the highlight around other occurrences of the same name.

Minimal reproduction project

N/A

@blackears
Copy link
Author

@Lielay9
Copy link
Contributor

Lielay9 commented Jun 3, 2023

The color is driven by text_editor/theme/highlighting/word_highlighted_color. (The currently selected text will be also be mixed with text_editor/theme/highlighting/selection_color)

kuva

For clearer results, you can try increasing the alpha of word_highlighted_color( and decrease the alpha of selection_color to compensate the increased brightness.) These changes could also be made to the default theme.

Personally, I rely on this feature so often that I'd wish there was an option to underline and/or have borders like in text_editor/theme/highlighting/search_result_border_color.

Search results border:

kuva

@Calinou
Copy link
Member

Calinou commented Jun 5, 2023

I wouldn't make word highlight color too similar to selection color by increasing this opacity a lot, as it then becomes an accessibility issue in the other direction.

For reference, VS Code uses different colors for selection and word highlight (selection is on the left):

image

In search results, it looks like this:

image

@Lielay9
Copy link
Contributor

Lielay9 commented Jun 5, 2023

I wouldn't make word highlight color too similar to selection color by increasing this opacity a lot, as it then becomes an accessibility issue in the other direction.

Ideally the selection color should be applied on top of the highlighted color (or not have selection highlighted). That way both colors could be made distinct without hurting the readability of the other.

Edit: Visualizing the problem:
For example all themes here https://github.com/godotengine/godot-syntax-themes/tree/4.0-dev use colors that have alpha set to 1, hence the selection color is actually not visible when the full word is highlighted:
Word partially selected:

kuva

Guess which one I've selected:

kuva

@Calinou
Copy link
Member

Calinou commented Jun 30, 2024

Closing in favor of godotengine/godot-proposals#7785.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants