You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use (r)find_char instead of (r)find for single characters
This commit is contained in:
@@ -205,7 +205,7 @@ Dictionary CodeHighlighter::_get_line_syntax_highlighting_impl(int p_line) {
|
||||
if (end_key_length == 0 || color_regions[c].line_only || from + end_key_length > line_length) {
|
||||
if (from + end_key_length > line_length && (color_regions[in_region].start_key == "\"" || color_regions[in_region].start_key == "\'")) {
|
||||
// If it's key length and there is a '\', dont skip to highlight esc chars.
|
||||
if (str.find("\\", from) >= 0) {
|
||||
if (str.find_char('\\', from) >= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -242,7 +242,7 @@ Dictionary CodeHighlighter::_get_line_syntax_highlighting_impl(int p_line) {
|
||||
for (; from < line_length; from++) {
|
||||
if (line_length - from < end_key_length) {
|
||||
// Don't break if '\' to highlight esc chars.
|
||||
if (!is_string || str.find("\\", from) < 0) {
|
||||
if (!is_string || str.find_char('\\', from) < 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user