@@ -184,16 +184,22 @@ void ScriptTextEditor::enable_editor(Control *p_shortcut_context) {
184184void ScriptTextEditor::_load_theme_settings () {
185185 CodeEdit *text_edit = code_editor->get_text_editor ();
186186
187+ Color updated_warning_line_color = EDITOR_GET (" text_editor/theme/highlighting/warning_color" );
187188 Color updated_marked_line_color = EDITOR_GET (" text_editor/theme/highlighting/mark_color" );
188189 Color updated_safe_line_number_color = EDITOR_GET (" text_editor/theme/highlighting/safe_line_number_color" );
189190 Color updated_folded_code_region_color = EDITOR_GET (" text_editor/theme/highlighting/folded_code_region_color" );
190191
191- bool safe_line_number_color_updated = updated_safe_line_number_color != safe_line_number_color ;
192+ bool warning_line_color_updated = updated_warning_line_color != warning_line_color ;
192193 bool marked_line_color_updated = updated_marked_line_color != marked_line_color;
194+ bool safe_line_number_color_updated = updated_safe_line_number_color != safe_line_number_color;
193195 bool folded_code_region_color_updated = updated_folded_code_region_color != folded_code_region_color;
194- if (safe_line_number_color_updated || marked_line_color_updated || folded_code_region_color_updated) {
196+ if (safe_line_number_color_updated || warning_line_color_updated || marked_line_color_updated || folded_code_region_color_updated) {
195197 safe_line_number_color = updated_safe_line_number_color;
196198 for (int i = 0 ; i < text_edit->get_line_count (); i++) {
199+ if (warning_line_color_updated && text_edit->get_line_background_color (i) == warning_line_color) {
200+ text_edit->set_line_background_color (i, updated_warning_line_color);
201+ }
202+
197203 if (marked_line_color_updated && text_edit->get_line_background_color (i) == marked_line_color) {
198204 text_edit->set_line_background_color (i, updated_marked_line_color);
199205 }
@@ -206,6 +212,7 @@ void ScriptTextEditor::_load_theme_settings() {
206212 text_edit->set_line_background_color (i, updated_folded_code_region_color);
207213 }
208214 }
215+ warning_line_color = updated_warning_line_color;
209216 marked_line_color = updated_marked_line_color;
210217 folded_code_region_color = updated_folded_code_region_color;
211218 }
@@ -567,8 +574,8 @@ void ScriptTextEditor::_validate_script() {
567574 script_is_valid = true ;
568575 }
569576 _update_connected_methods ();
570- _update_warnings ();
571577 _update_errors ();
578+ _update_warnings ();
572579
573580 emit_signal (SNAME (" name_changed" ));
574581 emit_signal (SNAME (" edited_script_changed" ));
@@ -637,6 +644,17 @@ void ScriptTextEditor::_update_warnings() {
637644 warnings_panel->pop (); // Cell.
638645 }
639646 warnings_panel->pop (); // Table.
647+ if (warning_line_color.a != 0.0 ) {
648+ CodeEdit *te = code_editor->get_text_editor ();
649+ for (int i = 0 ; i < te->get_line_count (); i++) {
650+ for (const ScriptLanguage::Warning &W : warnings) {
651+ if (i >= W.start_line - 1 && i < W.end_line ) {
652+ te->set_line_background_color (i, warning_line_color);
653+ break ;
654+ }
655+ }
656+ }
657+ }
640658}
641659
642660void ScriptTextEditor::_update_errors () {
@@ -706,7 +724,7 @@ void ScriptTextEditor::_update_errors() {
706724 if (errors.is_empty ()) {
707725 bool is_folded_code_region = te->is_line_code_region_start (i) && te->is_line_folded (i);
708726 te->set_line_background_color (i, is_folded_code_region ? folded_code_region_color : Color (0 , 0 , 0 , 0 ));
709- } else {
727+ } else if (marked_line_color. a != 0 ) {
710728 for (const ScriptLanguage::ScriptError &E : errors) {
711729 bool error_line = i == E.line - 1 ;
712730 te->set_line_background_color (i, error_line ? marked_line_color : Color (0 , 0 , 0 , 0 ));
@@ -1807,8 +1825,8 @@ void ScriptTextEditor::_notification(int p_what) {
18071825 break ;
18081826 }
18091827 if (is_visible_in_tree ()) {
1810- _update_warnings ();
18111828 _update_errors ();
1829+ _update_warnings ();
18121830 }
18131831 [[fallthrough]];
18141832 case NOTIFICATION_ENTER_TREE: {
0 commit comments