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

Method goto_line

editor/gui/code_editor.cpp:1377–1387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1375}
1376
1377void CodeTextEditor::goto_line(int p_line, int p_column) {
1378 text_editor->remove_secondary_carets();
1379 text_editor->deselect();
1380 text_editor->unfold_line(CLAMP(p_line, 0, text_editor->get_line_count() - 1));
1381 text_editor->set_caret_line(p_line, false);
1382 text_editor->set_caret_column(p_column, false);
1383 text_editor->set_code_hint("");
1384 text_editor->cancel_code_completion();
1385 // Defer in case the CodeEdit was just created and needs to be resized.
1386 callable_mp((TextEdit *)text_editor, &TextEdit::adjust_viewport_to_caret).call_deferred(0);
1387}
1388
1389void CodeTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
1390 text_editor->remove_secondary_carets();

Callers

nothing calls this directly

Calls 10

CLAMPFunction · 0.85
unfold_lineMethod · 0.80
set_caret_lineMethod · 0.80
set_code_hintMethod · 0.80
deselectMethod · 0.45
get_line_countMethod · 0.45
set_caret_columnMethod · 0.45
call_deferredMethod · 0.45

Tested by

no test coverage detected