Skip to content

Commit

Permalink
Merge pull request #91647 from jsjtxietian/fix-uint-hightlight
Browse files Browse the repository at this point in the history
Make native shader source visualizer highlight uint suffix
  • Loading branch information
akien-mga committed May 7, 2024
2 parents 2576add + cff1111 commit 107fd30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions editor/editor_native_shader_source_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ void EditorNativeShaderSourceVisualizer::_load_theme_settings() {
// Colorize preprocessor statements.
const Color user_type_color = EDITOR_GET("text_editor/theme/highlighting/user_type_color");
syntax_highlighter->add_color_region("#", "", user_type_color, true);

syntax_highlighter->set_uint_suffix_enabled(true);
}

void EditorNativeShaderSourceVisualizer::_inspect_shader(RID p_shader) {
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/text_shader_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ void ShaderTextEditor::_load_theme_settings() {
warnings_panel->add_theme_font_size_override("normal_font_size", EditorNode::get_singleton()->get_editor_theme()->get_font_size(SNAME("main_size"), EditorStringName(EditorFonts)));
}

syntax_highlighter->set_uint_suffix_enabled();
syntax_highlighter->set_uint_suffix_enabled(true);
}

void ShaderTextEditor::_check_shader_mode() {
Expand Down
2 changes: 1 addition & 1 deletion scene/resources/syntax_highlighter.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CodeHighlighter : public SyntaxHighlighter {
void set_member_variable_color(Color p_color);
Color get_member_variable_color() const;

void set_uint_suffix_enabled(bool p_enabled = true);
void set_uint_suffix_enabled(bool p_enabled);
};

#endif // SYNTAX_HIGHLIGHTER_H

0 comments on commit 107fd30

Please sign in to comment.