Merge pull request #11314 from marcelofg55/master

Fix possible crash with ctrl-u on script editor
This commit is contained in:
Rémi Verschelde 2017-09-17 12:56:13 +02:00 committed by GitHub
commit 0953c8fd55

View file

@ -2800,11 +2800,11 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
int ini = selection.from_line;
int end = selection.to_line;
for (int i = ini; i <= end; i++) {
if (text[i][0] == '#')
if (get_line(i).begins_with("#"))
_remove_text(i, 0, i, 1);
}
} else {
if (text[cursor.line][0] == '#')
if (get_line(cursor.line).begins_with("#"))
_remove_text(cursor.line, 0, cursor.line, 1);
}
update();