Skip to content

Commit

Permalink
Fix bug related to multicursor and backspacing with brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettgu10 committed Mar 14, 2024
1 parent da945ce commit 4ab08fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scene/gui/code_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,15 @@ void CodeEdit::_backspace_internal(int p_caret) {
prev_column = cc - auto_brace_completion_pairs[idx].open_key.length();

if (_get_auto_brace_pair_close_at_pos(cl, cc) == idx) {
remove_text(prev_line, prev_column, cl, cc + auto_brace_completion_pairs[idx].close_key.length());
} else {
remove_text(prev_line, prev_column, cl, cc);
cc += auto_brace_completion_pairs[idx].close_key.length();
}

remove_text(prev_line, prev_column, cl, cc);

set_caret_line(prev_line, false, true, 0, i);
set_caret_column(prev_column, i == 0, i);

adjust_carets_after_edit(i, prev_line, prev_column, cl, cc + auto_brace_completion_pairs[idx].close_key.length());
adjust_carets_after_edit(i, prev_line, prev_column, cl, cc);
continue;
}
}
Expand Down

0 comments on commit 4ab08fb

Please sign in to comment.