summaryrefslogtreecommitdiffstats
path: root/editor/plugins/text_shader_editor.cpp
diff options
context:
space:
mode:
authorMagian <zang_magian@163.com>2024-05-14 15:32:47 +0800
committerMagian <zang_magian@163.com>2024-05-14 15:32:47 +0800
commit8a92615ba0456844e6368f31be42ecf738ae88e7 (patch)
tree77ca65eb4c09c91d5b7c6200a21a74debd891142 /editor/plugins/text_shader_editor.cpp
parentf91db3dc58f1d6a0cb63d591515183b5a45cd3ba (diff)
downloadredot-engine-8a92615ba0456844e6368f31be42ecf738ae88e7.tar.gz
Resolve conflict between shader uniform tooltips "/**" and general annotation "/**/".
Diffstat (limited to 'editor/plugins/text_shader_editor.cpp')
-rw-r--r--editor/plugins/text_shader_editor.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp
index 83a1700306..ad6464c6a2 100644
--- a/editor/plugins/text_shader_editor.cpp
+++ b/editor/plugins/text_shader_editor.cpp
@@ -313,6 +313,8 @@ void ShaderTextEditor::_load_theme_settings() {
const Color doc_comment_color = EDITOR_GET("text_editor/theme/highlighting/doc_comment_color");
syntax_highlighter->add_color_region("/**", "*/", doc_comment_color, false);
+ // "/**/" will be treated as the start of the "/**" region, this line is guaranteed to end the color_region.
+ syntax_highlighter->add_color_region("/**/", "", comment_color, true);
// Disabled preprocessor branches use translucent text color to be easier to distinguish from comments.
syntax_highlighter->set_disabled_branch_color(Color(EDITOR_GET("text_editor/theme/highlighting/text_color")) * Color(1, 1, 1, 0.5));