summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/TextEdit.xml7
-rw-r--r--modules/gdscript/gdscript_compiler.cpp3
-rw-r--r--scene/gui/text_edit.cpp1
3 files changed, 11 insertions, 0 deletions
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index e2467b84a1..b97728ccd4 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -283,6 +283,13 @@
Returns the selection end line.
</description>
</method>
+ <method name="get_visible_line_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the number of visible lines, including wrapped text.
+ </description>
+ </method>
<method name="get_word_under_cursor" qualifiers="const">
<return type="String">
</return>
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index f495b0d787..4ac9864d4f 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -971,6 +971,9 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
} else {
gen->write_set(prev_base, key, assigned);
}
+ if (key.mode == GDScriptCodeGenerator::Address::TEMPORARY) {
+ gen->pop_temporary();
+ }
if (assigned.mode == GDScriptCodeGenerator::Address::TEMPORARY) {
gen->pop_temporary();
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index ba98b3c931..e305c6210d 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -6853,6 +6853,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("get_visible_line_count"), &TextEdit::get_total_visible_rows);
ClassDB::bind_method(D_METHOD("set_line", "line", "new_text"), &TextEdit::set_line);
ClassDB::bind_method(D_METHOD("set_structured_text_bidi_override", "parser"), &TextEdit::set_structured_text_bidi_override);