Fix line folding with multiple carets
This commit is contained in:
parent
253396ba39
commit
5906d6de8e
@ -1225,8 +1225,13 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
||||
code_editor->duplicate_selection();
|
||||
} break;
|
||||
case EDIT_TOGGLE_FOLD_LINE: {
|
||||
for (int caret_idx = 0; caret_idx < tx->get_caret_count(); caret_idx++) {
|
||||
tx->toggle_foldable_line(tx->get_caret_line(caret_idx));
|
||||
int previous_line = -1;
|
||||
for (int caret_idx : tx->get_caret_index_edit_order()) {
|
||||
int line_idx = tx->get_caret_line(caret_idx);
|
||||
if (line_idx != previous_line) {
|
||||
tx->toggle_foldable_line(line_idx);
|
||||
previous_line = line_idx;
|
||||
}
|
||||
}
|
||||
tx->queue_redraw();
|
||||
} break;
|
||||
|
@ -397,8 +397,13 @@ void TextEditor::_edit_option(int p_op) {
|
||||
code_editor->duplicate_selection();
|
||||
} break;
|
||||
case EDIT_TOGGLE_FOLD_LINE: {
|
||||
for (int caret_idx = 0; caret_idx < tx->get_caret_count(); caret_idx++) {
|
||||
tx->toggle_foldable_line(tx->get_caret_line(caret_idx));
|
||||
int previous_line = -1;
|
||||
for (int caret_idx : tx->get_caret_index_edit_order()) {
|
||||
int line_idx = tx->get_caret_line(caret_idx);
|
||||
if (line_idx != previous_line) {
|
||||
tx->toggle_foldable_line(line_idx);
|
||||
previous_line = line_idx;
|
||||
}
|
||||
}
|
||||
tx->queue_redraw();
|
||||
} break;
|
||||
|
Loading…
Reference in New Issue
Block a user