diff options
| author | jpcerrone <jpcerronex@gmail.com> | 2023-07-07 11:18:30 -0300 |
|---|---|---|
| committer | jpcerrone <jpcerronex@gmail.com> | 2023-07-07 11:18:30 -0300 |
| commit | 71b8a9d2744bab4c83f38f2d0606b3f0df5f6bae (patch) | |
| tree | 75a6405041445ec86ff3b63e03f60210ab63b518 | |
| parent | 443820686cad24bbdd7e7050fa3d3f33f43a7bb5 (diff) | |
| download | redot-engine-71b8a9d2744bab4c83f38f2d0606b3f0df5f6bae.tar.gz | |
Fix comments and indentation in .gdshaderinc files
Fixes #78205
The handling of comments and indentation in the shader editor
wasn't considering shader include files.
| -rw-r--r-- | editor/plugins/text_shader_editor.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index 0c8907d6a0..4838661fa8 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -646,13 +646,13 @@ void TextShaderEditor::_menu_option(int p_option) { shader_editor->move_lines_down(); } break; case EDIT_INDENT: { - if (shader.is_null()) { + if (shader.is_null() && shader_inc.is_null()) { return; } shader_editor->get_text_editor()->indent_lines(); } break; case EDIT_UNINDENT: { - if (shader.is_null()) { + if (shader.is_null() && shader_inc.is_null()) { return; } shader_editor->get_text_editor()->unindent_lines(); @@ -668,12 +668,10 @@ void TextShaderEditor::_menu_option(int p_option) { shader_editor->get_text_editor()->set_line_wrapping_mode(wrap == TextEdit::LINE_WRAPPING_BOUNDARY ? TextEdit::LINE_WRAPPING_NONE : TextEdit::LINE_WRAPPING_BOUNDARY); } break; case EDIT_TOGGLE_COMMENT: { - if (shader.is_null()) { + if (shader.is_null() && shader_inc.is_null()) { return; } - shader_editor->toggle_inline_comment("//"); - } break; case EDIT_COMPLETE: { shader_editor->get_text_editor()->request_code_completion(); |
