Make shader language editors inherit the same base class

This commit is contained in:
Aaron Franke 2024-07-12 11:56:49 -07:00
parent ee363af0ed
commit 99e997ae15
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
8 changed files with 120 additions and 61 deletions

View file

@ -3799,7 +3799,10 @@ void ScriptEditor::_on_find_in_files_result_selected(const String &fpath, int li
ShaderEditorPlugin *shader_editor = Object::cast_to<ShaderEditorPlugin>(EditorNode::get_editor_data().get_editor_by_name("Shader"));
shader_editor->edit(res.ptr());
shader_editor->make_visible(true);
shader_editor->get_shader_editor(res)->goto_line_selection(line_number - 1, begin, end);
TextShaderEditor *text_shader_editor = Object::cast_to<TextShaderEditor>(shader_editor->get_shader_editor(res));
if (text_shader_editor) {
text_shader_editor->goto_line_selection(line_number - 1, begin, end);
}
return;
} else if (fpath.get_extension() == "tscn") {
Ref<FileAccess> f = FileAccess::open(fpath, FileAccess::READ);