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

Method delete_lines

scene/gui/code_edit.cpp:2628–2649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2626}
2627
2628void CodeEdit::delete_lines() {
2629 begin_complex_operation();
2630 begin_multicaret_edit();
2631
2632 Vector<Point2i> line_ranges = get_line_ranges_from_carets();
2633 int line_offset = 0;
2634 for (Point2i line_range : line_ranges) {
2635 // Remove last line of range separately to preserve carets.
2636 unfold_line(line_range.y + line_offset);
2637 remove_line_at(line_range.y + line_offset);
2638 if (line_range.x != line_range.y) {
2639 remove_text(line_range.x + line_offset, 0, line_range.y + line_offset, 0);
2640 }
2641 line_offset += line_range.x - line_range.y - 1;
2642 }
2643
2644 // Deselect all.
2645 deselect();
2646
2647 end_multicaret_edit();
2648 end_complex_operation();
2649}
2650
2651void CodeEdit::duplicate_selection() {
2652 begin_complex_operation();

Callers 5

_edit_optionMethod · 0.80
_edit_optionMethod · 0.80
_menu_optionMethod · 0.80
inputMethod · 0.80
test_code_edit.hFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected