diff options
Diffstat (limited to 'scene/resources/syntax_highlighter.cpp')
-rw-r--r-- | scene/resources/syntax_highlighter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp index 441c8859cf..6da4215031 100644 --- a/scene/resources/syntax_highlighter.cpp +++ b/scene/resources/syntax_highlighter.cpp @@ -303,7 +303,7 @@ Dictionary CodeHighlighter::_get_line_syntax_highlighting_impl(int p_line) { } // Check for dot or underscore or 'x' for hex notation in floating point number or 'e' for scientific notation. - if ((str[j] == '.' || str[j] == 'x' || str[j] == '_' || str[j] == 'f' || str[j] == 'e') && !in_word && prev_is_number && !is_number) { + if ((str[j] == '.' || str[j] == 'x' || str[j] == '_' || str[j] == 'f' || str[j] == 'e' || (uint_suffix_enabled && str[j] == 'u')) && !in_word && prev_is_number && !is_number) { is_number = true; is_a_symbol = false; is_char = false; @@ -313,7 +313,7 @@ Dictionary CodeHighlighter::_get_line_syntax_highlighting_impl(int p_line) { } } - if (!in_word && (is_ascii_char(str[j]) || is_underscore(str[j])) && !is_number) { + if (!in_word && (is_ascii_alphabet_char(str[j]) || is_underscore(str[j])) && !is_number) { in_word = true; } @@ -617,6 +617,10 @@ void CodeHighlighter::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "color_regions"), "set_color_regions", "get_color_regions"); } +void CodeHighlighter::set_uint_suffix_enabled(bool p_enabled) { + uint_suffix_enabled = p_enabled; +} + void CodeHighlighter::set_number_color(Color p_color) { number_color = p_color; clear_highlighting_cache(); |