From 699afca7ef6556c1c30539291a7c8af0c3fcc4d6 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Wed, 7 Aug 2019 23:06:33 -0300 Subject: [PATCH] Fix error when going to a text file by clicking in a result from "Find in files" --- editor/find_in_files.cpp | 1 + editor/plugins/script_editor_plugin.cpp | 51 ++++++++++++++----------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index e1ab5c62a7b..8665467f2da 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -524,6 +524,7 @@ FindInFilesPanel::FindInFilesPanel() { _progress_bar = memnew(ProgressBar); _progress_bar->set_h_size_flags(SIZE_EXPAND_FILL); + _progress_bar->set_v_size_flags(SIZE_SHRINK_CENTER); hbc->add_child(_progress_bar); set_progress_visible(false); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 02d4b9d1d7e..16cc9978eea 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2989,35 +2989,40 @@ void ScriptEditor::_on_find_in_files_requested(String text) { void ScriptEditor::_on_find_in_files_result_selected(String fpath, int line_number, int begin, int end) { - RES res = ResourceLoader::load(fpath); - if (fpath.get_extension() == "shader") { - ShaderEditorPlugin *shader_editor = Object::cast_to(EditorNode::get_singleton()->get_editor_data().get_editor("Shader")); - shader_editor->edit(res.ptr()); - shader_editor->make_visible(true); - shader_editor->get_shader_editor()->goto_line_selection(line_number - 1, begin, end); - } else { - Ref