diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-12-08 18:45:54 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-12-08 18:45:54 +0100 |
commit | 6269341461006144c30b6362084e8e836a341bd7 (patch) | |
tree | ed8150922c04aa93fed0603611243ffdfaddd4fd | |
parent | aec890b496ef2fa8d0c1f7704ac53d4d685c3c85 (diff) | |
parent | 609eb8bc016bebdc698cb8bf8d8a076c5d92c9a7 (diff) | |
download | redot-engine-6269341461006144c30b6362084e8e836a341bd7.tar.gz |
Merge pull request #85054 from miv391/highlight-minimap-error-lines
Highlight error lines in minimap
-rw-r--r-- | scene/gui/text_edit.cpp | 9 | ||||
-rw-r--r-- | tests/scene/test_text_edit.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 86e726d9da..5817f70343 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -770,7 +770,14 @@ void TextEdit::_notification(int p_what) { Dictionary color_map = _get_line_syntax_highlighting(minimap_line); Color line_background_color = text.get_line_background_color(minimap_line); - line_background_color.a *= 0.6; + + if (line_background_color != theme_cache.background_color) { + // Make non-default background colors more visible, such as error markers. + line_background_color.a = 1.0; + } else { + line_background_color.a *= 0.6; + } + Color current_color = theme_cache.font_color; if (!editable) { current_color = theme_cache.font_readonly_color; diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h index 9c9ade4445..e81578a862 100644 --- a/tests/scene/test_text_edit.h +++ b/tests/scene/test_text_edit.h @@ -4118,7 +4118,7 @@ TEST_CASE("[SceneTree][TextEdit] setter getters") { CHECK_FALSE(text_edit->is_drawing_spaces()); } - SUBCASE("[TextEdit] draw minimao") { + SUBCASE("[TextEdit] draw minimap") { text_edit->set_draw_minimap(true); CHECK(text_edit->is_drawing_minimap()); text_edit->set_draw_minimap(false); |