Skip to content

Commit 7c31b8f

Browse files
committed
Fix Evaluator's format issues caused by special characters in the expression
1 parent 2d113cc commit 7c31b8f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

editor/debugger/editor_debugger_inspector.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ void EditorDebuggerInspector::add_stack_variable(const Array &p_array, int p_off
389389
}
390390

391391
PropertyInfo pinfo;
392-
pinfo.name = type + n;
392+
// Encode special characters to avoid issues with expressions in Evaluator.
393+
// Dots are skipped by uri_encode(), but uri_decode() process them correctly when replaced with "%2E".
394+
pinfo.name = type + n.uri_encode().replace(".", "%2E");
393395
pinfo.type = v.get_type();
394396
pinfo.hint = h;
395397
pinfo.hint_string = hs;
@@ -403,7 +405,7 @@ void EditorDebuggerInspector::add_stack_variable(const Array &p_array, int p_off
403405
}
404406
variables->prop_list.insert_before(current, pinfo);
405407
}
406-
variables->prop_values[type + n][0] = v;
408+
variables->prop_values[pinfo.name][0] = v;
407409
variables->update();
408410
edit(variables);
409411
}

editor/inspector/editor_inspector.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3977,6 +3977,7 @@ void EditorInspector::update_tree() {
39773977
name_override = name_override.substr(0, dot);
39783978
}
39793979
}
3980+
name_override = name_override.uri_decode();
39803981

39813982
// Don't localize script variables.
39823983
EditorPropertyNameProcessor::Style name_style = property_name_style;

0 commit comments

Comments
 (0)