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

Method reload_text

editor/script/script_text_editor.cpp:353–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void ScriptTextEditor::reload_text() {
354 ERR_FAIL_COND(script.is_null());
355
356 CodeEdit *te = code_editor->get_text_editor();
357 int column = te->get_caret_column();
358 int row = te->get_caret_line();
359 int h = te->get_h_scroll();
360 int v = te->get_v_scroll();
361
362 te->set_text(script->get_source_code());
363 te->set_caret_line(row);
364 te->set_caret_column(column);
365 te->set_h_scroll(h);
366 te->set_v_scroll(v);
367
368 te->tag_saved_version();
369
370 code_editor->update_line_and_column();
371 if (editor_enabled) {
372 _validate_script();
373 }
374}
375
376void ScriptTextEditor::add_callback(const String &p_function, const PackedStringArray &p_args) {
377 ScriptLanguage *language = script->get_language();

Callers

nothing calls this directly

Calls 14

get_text_editorMethod · 0.80
get_caret_lineMethod · 0.80
set_caret_lineMethod · 0.80
is_nullMethod · 0.45
get_caret_columnMethod · 0.45
get_h_scrollMethod · 0.45
get_v_scrollMethod · 0.45
set_textMethod · 0.45
get_source_codeMethod · 0.45
set_caret_columnMethod · 0.45
set_h_scrollMethod · 0.45

Tested by

no test coverage detected