summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThakee Nathees <thakeenathees@gmail.com>2020-05-01 17:54:49 +0530
committerThakee Nathees <thakeenathees@gmail.com>2020-05-01 18:37:12 +0530
commitb9acf1cedf21c47b51fa1bf4fbe2f904c5bd0275 (patch)
tree0b8d0a094d7a89d6859a071646f30226d76c8025
parent92d4a0cbd231508221b0e977ae9a0e9d4207e328 (diff)
method bind TextEdit::set_line() added
-rw-r--r--doc/classes/TextEdit.xml11
-rw-r--r--scene/gui/text_edit.cpp1
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index b7cf93d672..bb2d355bf6 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -354,6 +354,17 @@
If [code]true[/code], hides the line of the specified index.
</description>
</method>
+ <method name="set_line">
+ <return type="void">
+ </return>
+ <argument index="0" name="line" type="int">
+ </argument>
+ <argument index="1" name="new_text" type="String">
+ </argument>
+ <description>
+ Sets the text for a specific line.
+ </description>
+ </method>
<method name="toggle_fold_line">
<return type="void">
</return>
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 9ee7456d26..b3c021c2a5 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -7083,6 +7083,7 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_line_count"), &TextEdit::get_line_count);
ClassDB::bind_method(D_METHOD("get_text"), &TextEdit::get_text);
ClassDB::bind_method(D_METHOD("get_line", "line"), &TextEdit::get_line);
+ ClassDB::bind_method(D_METHOD("set_line", "line", "new_text"), &TextEdit::set_line);
ClassDB::bind_method(D_METHOD("center_viewport_to_cursor"), &TextEdit::center_viewport_to_cursor);
ClassDB::bind_method(D_METHOD("cursor_set_column", "column", "adjust_viewport"), &TextEdit::cursor_set_column, DEFVAL(true));