summaryrefslogtreecommitdiff
path: root/modules/gdscript/editor
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2022-05-26 12:56:39 -0300
committerGeorge Marques <george@gmarqu.es>2022-05-27 13:46:18 -0300
commiteba3e0a9fce1f10e8ad7311e84e9f3d38dae008e (patch)
treeef292d28ba674b16bcbf7d51b9a45a566eb27516 /modules/gdscript/editor
parentd81c5eab8cfd1d91ef2cf1599a6b929ccbed0a3a (diff)
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.
Diffstat (limited to 'modules/gdscript/editor')
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index 191568661d..b86e9b386d 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -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;
}