diff options
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r-- | scene/gui/line_edit.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 3f979f7c20..b7c7326172 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1452,13 +1452,12 @@ void LineEdit::undo() { return; } + if (!has_undo()) { + return; + } + if (undo_stack_pos == nullptr) { - if (undo_stack.size() <= 1) { - return; - } undo_stack_pos = undo_stack.back(); - } else if (undo_stack_pos == undo_stack.front()) { - return; } deselect(); @@ -1479,10 +1478,7 @@ void LineEdit::redo() { return; } - if (undo_stack_pos == nullptr) { - return; - } - if (undo_stack_pos == undo_stack.back()) { + if (!has_redo()) { return; } |