Merge pull request #101319 from JulianHeuser/region_syntax_highlighting_fix
Improve consistency of code regions
This commit is contained in:
@ -1872,7 +1872,8 @@ bool CodeEdit::is_line_code_region_start(int p_line) const {
|
||||
if (is_in_string(p_line) != -1) {
|
||||
return false;
|
||||
}
|
||||
return get_line(p_line).strip_edges().begins_with(code_region_start_string);
|
||||
Vector<String> split = get_line(p_line).strip_edges().split_spaces();
|
||||
return split.size() > 0 && split[0] == code_region_start_string;
|
||||
}
|
||||
|
||||
bool CodeEdit::is_line_code_region_end(int p_line) const {
|
||||
@ -1883,7 +1884,8 @@ bool CodeEdit::is_line_code_region_end(int p_line) const {
|
||||
if (is_in_string(p_line) != -1) {
|
||||
return false;
|
||||
}
|
||||
return get_line(p_line).strip_edges().begins_with(code_region_end_string);
|
||||
Vector<String> split = get_line(p_line).strip_edges().split_spaces();
|
||||
return split.size() > 0 && split[0] == code_region_end_string;
|
||||
}
|
||||
|
||||
/* Delimiters */
|
||||
|
||||
Reference in New Issue
Block a user