summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-11-06 15:43:21 +0100
committerYuri Sizov <yuris@humnom.net>2023-11-06 15:43:21 +0100
commit14cc639bc365769b8d5ea1f211f0a82c16dbef25 (patch)
treece4bbca2b6a4e70ee8d5baaea194b0877e2ca0e9 /editor/plugins/script_editor_plugin.cpp
parentb7449a3d1aebd34026c7a2279a1b18ff0f02ccfa (diff)
parent155d738163d46333562f68ebb5d62f3ea2d95145 (diff)
downloadredot-engine-14cc639bc365769b8d5ea1f211f0a82c16dbef25.tar.gz
Merge pull request #81018 from jsjtxietian/return-use-friendly-info-in-scriptStackVariable-serialize
Fix `_get_debug_tooltip` crash if tooltip string is too large
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r--editor/plugins/script_editor_plugin.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 22596c09d1..f866bd2a01 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -433,7 +433,11 @@ ScriptEditor *ScriptEditor::script_editor = nullptr;
String ScriptEditor::_get_debug_tooltip(const String &p_text, Node *_se) {
String val = EditorDebuggerNode::get_singleton()->get_var_value(p_text);
+ const int display_limit = 300;
if (!val.is_empty()) {
+ if (val.size() > display_limit) {
+ val = val.left(display_limit) + " [...] truncated!";
+ }
return p_text + ": " + val;
} else {
return String();