Merge pull request #91497 from magian1127/4.0fixShaderHighlighting

Fix shader highlighting the interruption in `color_region` caused by `disabled_branch_regions`.
This commit is contained in:
Rémi Verschelde 2024-05-13 17:32:02 +02:00
commit 194c940e72
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -49,6 +49,11 @@ Dictionary GDShaderSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l
for (const Point2i &region : disabled_branch_regions) {
if (p_line >= region.x && p_line <= region.y) {
// When "color_regions[0].p_start_key.length() > 2",
// disabled_branch_region causes color_region to break.
// This should be seen as a temporary solution.
CodeHighlighter::_get_line_syntax_highlighting_impl(p_line);
Dictionary highlighter_info;
highlighter_info["color"] = disabled_branch_color;