Merge pull request #25350 from Connall/master

Fix "Auto Brace Complete" inserting extra quotation character sometimes in a string.
This commit is contained in:
Rémi Verschelde 2019-05-01 10:32:41 +02:00 committed by GitHub
commit f3eafcec1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1560,8 +1560,7 @@ void TextEdit::_consume_pair_symbol(CharType ch) {
}
if ((ch == '\'' || ch == '"') &&
cursor_get_column() > 0 &&
_is_text_char(text[cursor.line][cursor_get_column() - 1])) {
cursor_get_column() > 0 && _is_text_char(text[cursor.line][cursor_get_column() - 1]) && !_is_pair_right_symbol(text[cursor.line][cursor_get_column()])) {
insert_text_at_cursor(ch_single);
cursor_set_column(cursor_position_to_move);
return;