Skip to content

Commit 77f779d

Browse files
committed
Merge pull request godotengine#97167 from MewPurPur/reveal-undoredo
Expose `has_undo()` and `has_redo()` of LineEdit
2 parents 8738aae + f7a7ecc commit 77f779d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

doc/classes/LineEdit.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,24 @@
151151
Returns [code]true[/code] if the user has text in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME).
152152
</description>
153153
</method>
154+
<method name="has_redo" qualifiers="const">
155+
<return type="bool" />
156+
<description>
157+
Returns [code]true[/code] if a "redo" action is available.
158+
</description>
159+
</method>
154160
<method name="has_selection" qualifiers="const">
155161
<return type="bool" />
156162
<description>
157163
Returns [code]true[/code] if the user has selected text.
158164
</description>
159165
</method>
166+
<method name="has_undo" qualifiers="const">
167+
<return type="bool" />
168+
<description>
169+
Returns [code]true[/code] if an "undo" action is available.
170+
</description>
171+
</method>
160172
<method name="insert_text_at_caret">
161173
<return type="void" />
162174
<param index="0" name="text" type="String" />

scene/gui/line_edit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,6 +2764,8 @@ void LineEdit::_bind_methods() {
27642764
ClassDB::bind_method(D_METHOD("select", "from", "to"), &LineEdit::select, DEFVAL(0), DEFVAL(-1));
27652765
ClassDB::bind_method(D_METHOD("select_all"), &LineEdit::select_all);
27662766
ClassDB::bind_method(D_METHOD("deselect"), &LineEdit::deselect);
2767+
ClassDB::bind_method(D_METHOD("has_undo"), &LineEdit::has_undo);
2768+
ClassDB::bind_method(D_METHOD("has_redo"), &LineEdit::has_redo);
27672769
ClassDB::bind_method(D_METHOD("has_selection"), &LineEdit::has_selection);
27682770
ClassDB::bind_method(D_METHOD("get_selected_text"), &LineEdit::get_selected_text);
27692771
ClassDB::bind_method(D_METHOD("get_selection_from_column"), &LineEdit::get_selection_from_column);

0 commit comments

Comments
 (0)