aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Fernandez2017-09-16 04:20:20 -0300
committerMarcelo Fernandez2017-09-16 04:20:20 -0300
commita2837360d0067151e1916922940c6f982fecd974 (patch)
treea5534aef1a2bc52584ea2778b6b7fd66bde447a4
parent62cb43bb8dec8f5078012b58ff06a2077078565f (diff)
downloadgodot-a2837360d0067151e1916922940c6f982fecd974.tar.gz
godot-a2837360d0067151e1916922940c6f982fecd974.tar.zst
godot-a2837360d0067151e1916922940c6f982fecd974.zip
Fix possible crash with ctrl-u on script editor
-rw-r--r--scene/gui/text_edit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 1738e303a..9c8e95b44 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2793,11 +2793,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();