summaryrefslogtreecommitdiffstats
path: root/scene/gui/line_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r--scene/gui/line_edit.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 9967805134..b7c7326172 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -128,6 +128,7 @@ bool LineEdit::has_ime_text() const {
void LineEdit::cancel_ime() {
if (!has_ime_text()) {
+ _close_ime_window();
return;
}
ime_text = String();
@@ -140,6 +141,7 @@ void LineEdit::cancel_ime() {
void LineEdit::apply_ime() {
if (!has_ime_text()) {
+ _close_ime_window();
return;
}
@@ -1450,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();
@@ -1477,10 +1478,7 @@ void LineEdit::redo() {
return;
}
- if (undo_stack_pos == nullptr) {
- return;
- }
- if (undo_stack_pos == undo_stack.back()) {
+ if (!has_redo()) {
return;
}