| 3122 | } |
| 3123 | |
| 3124 | void ScriptEditor::_files_moved(const String &p_old_file, const String &p_new_file) { |
| 3125 | if (!script_editor_cache->has_section(p_old_file)) { |
| 3126 | return; |
| 3127 | } |
| 3128 | |
| 3129 | for (int i = 0; i < tab_container->get_tab_count(); i++) { |
| 3130 | ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(i)); |
| 3131 | if (se && se->edited_file_data.path == p_old_file) { |
| 3132 | se->edited_file_data.path = p_new_file; |
| 3133 | break; |
| 3134 | } |
| 3135 | } |
| 3136 | |
| 3137 | Variant state = script_editor_cache->get_value(p_old_file, "state"); |
| 3138 | script_editor_cache->erase_section(p_old_file); |
| 3139 | script_editor_cache->set_value(p_new_file, "state", state); |
| 3140 | |
| 3141 | // If Script, update breakpoints with debugger. |
| 3142 | Array breakpoints = _get_cached_breakpoints_for_script(p_new_file); |
| 3143 | for (int breakpoint : breakpoints) { |
| 3144 | int line = (int)breakpoint + 1; |
| 3145 | EditorDebuggerNode::get_singleton()->set_breakpoint(p_old_file, line, false); |
| 3146 | if (!p_new_file.begins_with("local://") && ResourceLoader::exists(p_new_file, "Script")) { |
| 3147 | EditorDebuggerNode::get_singleton()->set_breakpoint(p_new_file, line, true); |
| 3148 | } |
| 3149 | } |
| 3150 | // This is saved later when we save the editor layout. |
| 3151 | } |
| 3152 | |
| 3153 | void ScriptEditor::_file_removed(const String &p_removed_file) { |
| 3154 | for (int i = 0; i < tab_container->get_tab_count(); i++) { |
nothing calls this directly
no test coverage detected