mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Clear function made godot crashing because line_number is below 0
- Adding a MAX(0, index) in order to have at least 0 inserted in the history
This commit is contained in:
parent
68877ead9a
commit
d0641a7528
1 changed files with 1 additions and 1 deletions
|
|
@ -3212,7 +3212,7 @@ void TextEdit::_clear() {
|
|||
op.type = TextOperation::TYPE_CLEAR;
|
||||
op.from_line = 0;
|
||||
op.from_column = 0;
|
||||
op.to_line = get_line_count() - 1;
|
||||
op.to_line = MAX(0, get_line_count() - 1);
|
||||
op.to_column = get_line(op.to_line).length();
|
||||
op.text = undo_text;
|
||||
op.version = ++version;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue