diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-09-17 12:56:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-17 12:56:13 +0200 |
commit | 0953c8fd55531ca642444bc49567bdebd59192aa (patch) | |
tree | 9a95006085dd74610efb5f10b76af57c294c1be4 /scene | |
parent | 317512e2fb47cb024c58b907a149251882665580 (diff) | |
parent | a2837360d0067151e1916922940c6f982fecd974 (diff) |
Merge pull request #11314 from marcelofg55/master
Fix possible crash with ctrl-u on script editor
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/text_edit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index dc5e4d1010..db6d257640 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -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(); |