MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _files_moved

Method _files_moved

editor/script/script_editor_plugin.cpp:3124–3151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3122}
3123
3124void 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
3153void ScriptEditor::_file_removed(const String &p_removed_file) {
3154 for (int i = 0; i < tab_container->get_tab_count(); i++) {

Callers

nothing calls this directly

Calls 8

get_tab_controlMethod · 0.80
erase_sectionMethod · 0.80
begins_withMethod · 0.80
has_sectionMethod · 0.45
get_tab_countMethod · 0.45
get_valueMethod · 0.45
set_valueMethod · 0.45
set_breakpointMethod · 0.45

Tested by

no test coverage detected