Fix the flickering of the line gutter icon when saving

This commit is contained in:
Rindbee 2022-10-03 18:38:24 +08:00
parent d331b803b8
commit 72a7d874b4
4 changed files with 2 additions and 13 deletions

View File

@ -2136,16 +2136,6 @@ void ScriptEditor::_update_script_names() {
_update_script_colors(); _update_script_colors();
} }
void ScriptEditor::_update_script_connections() {
for (int i = 0; i < tab_container->get_tab_count(); i++) {
ScriptTextEditor *ste = Object::cast_to<ScriptTextEditor>(tab_container->get_tab_control(i));
if (!ste) {
continue;
}
ste->_update_connected_methods();
}
}
Ref<TextFile> ScriptEditor::_load_text_file(const String &p_path, Error *r_error) const { Ref<TextFile> ScriptEditor::_load_text_file(const String &p_path, Error *r_error) const {
if (r_error) { if (r_error) {
*r_error = ERR_FILE_CANT_OPEN; *r_error = ERR_FILE_CANT_OPEN;
@ -2819,7 +2809,6 @@ void ScriptEditor::_tree_changed() {
waiting_update_names = true; waiting_update_names = true;
call_deferred(SNAME("_update_script_names")); call_deferred(SNAME("_update_script_names"));
call_deferred(SNAME("_update_script_connections"));
} }
void ScriptEditor::_split_dragged(float) { void ScriptEditor::_split_dragged(float) {
@ -3616,7 +3605,6 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_goto_script_line2", &ScriptEditor::_goto_script_line2); ClassDB::bind_method("_goto_script_line2", &ScriptEditor::_goto_script_line2);
ClassDB::bind_method("_copy_script_path", &ScriptEditor::_copy_script_path); ClassDB::bind_method("_copy_script_path", &ScriptEditor::_copy_script_path);
ClassDB::bind_method("_update_script_connections", &ScriptEditor::_update_script_connections);
ClassDB::bind_method("_help_class_open", &ScriptEditor::_help_class_open); ClassDB::bind_method("_help_class_open", &ScriptEditor::_help_class_open);
ClassDB::bind_method("_help_tab_goto", &ScriptEditor::_help_tab_goto); ClassDB::bind_method("_help_tab_goto", &ScriptEditor::_help_tab_goto);
ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts); ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts);

View File

@ -403,7 +403,6 @@ class ScriptEditor : public PanelContainer {
void _filter_scripts_text_changed(const String &p_newtext); void _filter_scripts_text_changed(const String &p_newtext);
void _filter_methods_text_changed(const String &p_newtext); void _filter_methods_text_changed(const String &p_newtext);
void _update_script_names(); void _update_script_names();
void _update_script_connections();
bool _sort_list_on_update; bool _sort_list_on_update;
void _members_overview_selected(int p_idx); void _members_overview_selected(int p_idx);

View File

@ -289,6 +289,7 @@ void ScriptTextEditor::reload_text() {
te->tag_saved_version(); te->tag_saved_version();
code_editor->update_line_and_column(); code_editor->update_line_and_column();
_validate_script();
} }
void ScriptTextEditor::add_callback(const String &p_function, PackedStringArray p_args) { void ScriptTextEditor::add_callback(const String &p_function, PackedStringArray p_args) {

View File

@ -150,6 +150,7 @@ void TextEditor::reload_text() {
te->tag_saved_version(); te->tag_saved_version();
code_editor->update_line_and_column(); code_editor->update_line_and_column();
_validate_script();
} }
void TextEditor::_validate_script() { void TextEditor::_validate_script() {