GDScript: Support % in shorthand for get_node
The `%` is used in scene unique nodes. Now `%` can also be used instead of `$` for the shorthand, besides being allowed generally anywhere in the path as the prefix for a node name.
This commit is contained in:
parent
d81c5eab8c
commit
eba3e0a9fc
11 changed files with 182 additions and 80 deletions
|
|
@ -387,9 +387,9 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l
|
|||
in_member_variable = false;
|
||||
}
|
||||
|
||||
if (!in_node_path && in_region == -1 && str[j] == '$') {
|
||||
if (!in_node_path && in_region == -1 && (str[j] == '$' || str[j] == '%')) {
|
||||
in_node_path = true;
|
||||
} else if (in_region != -1 || (is_a_symbol && str[j] != '/')) {
|
||||
} else if (in_region != -1 || (is_a_symbol && str[j] != '/' && str[j] != '%')) {
|
||||
in_node_path = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue