Skip to content

Commit

Permalink
Merge pull request #66040 from jeffres/fix-closing-shader-file-with-m…
Browse files Browse the repository at this point in the history
…iddle-mouse-click
  • Loading branch information
Chaosus authored Sep 18, 2022
2 parents e5594c2 + b9d9528 commit 9087953
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions editor/plugins/shader_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,11 +1376,10 @@ void ShaderEditorPlugin::_shader_list_clicked(int p_item, Vector2 p_local_mouse_
}

void ShaderEditorPlugin::_close_shader(int p_index) {
int index = shader_tabs->get_current_tab();
ERR_FAIL_INDEX(index, shader_tabs->get_tab_count());
Control *c = shader_tabs->get_tab_control(index);
ERR_FAIL_INDEX(p_index, shader_tabs->get_tab_count());
Control *c = shader_tabs->get_tab_control(p_index);
memdelete(c);
edited_shaders.remove_at(index);
edited_shaders.remove_at(p_index);
_update_shader_list();
EditorNode::get_singleton()->get_undo_redo()->clear_history(); // To prevent undo on deleted graphs.
}
Expand Down

0 comments on commit 9087953

Please sign in to comment.