mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Bugfix: Godot engine crashes due to _clear function
This commit is contained in:
parent
8befa3dd2f
commit
d7c349fea4
1 changed files with 18 additions and 15 deletions
|
|
@ -3204,9 +3204,11 @@ String TextEdit::get_line(int line) const {
|
||||||
void TextEdit::_clear() {
|
void TextEdit::_clear() {
|
||||||
|
|
||||||
if (undo_enabled) {
|
if (undo_enabled) {
|
||||||
_clear_redo();
|
|
||||||
String undo_text = get_text();
|
String undo_text = get_text();
|
||||||
|
|
||||||
|
if (undo_text.length() > 0) {
|
||||||
|
_clear_redo();
|
||||||
|
|
||||||
/* UNDO!! */
|
/* UNDO!! */
|
||||||
TextOperation op;
|
TextOperation op;
|
||||||
op.type = TextOperation::TYPE_CLEAR;
|
op.type = TextOperation::TYPE_CLEAR;
|
||||||
|
|
@ -3222,6 +3224,7 @@ void TextEdit::_clear() {
|
||||||
op.prev_version = get_version();
|
op.prev_version = get_version();
|
||||||
_push_current_op();
|
_push_current_op();
|
||||||
current_op = op;
|
current_op = op;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
clear_undo_history();
|
clear_undo_history();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue