Merge pull request #60231 from timothyqiu/undo-autocomplete

[3.x] Fix undo history for function name autocompletion
This commit is contained in:
Rémi Verschelde 2022-04-14 10:21:28 +02:00 committed by GitHub
commit 79bcfb8ef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6793,13 +6793,13 @@ void TextEdit::_confirm_completion() {
if (last_completion_char == '(') {
if (next_char == last_completion_char) {
_base_remove_text(cursor.line, cursor.column - 1, cursor.line, cursor.column);
_remove_text(cursor.line, cursor.column - 1, cursor.line, cursor.column);
} else if (auto_brace_completion_enabled) {
insert_text_at_cursor(")");
cursor.column--;
}
} else if (last_completion_char == ')' && next_char == '(') {
_base_remove_text(cursor.line, cursor.column - 2, cursor.line, cursor.column);
_remove_text(cursor.line, cursor.column - 2, cursor.line, cursor.column);
if (line[cursor.column + 1] != ')') {
cursor.column--;
}