Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make native shader source visualizer highlight uint suffix #91647

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading