Repository: godotengine/godot
File: editor/shader/shader_editor_plugin.cpp (C++)

Code before:
		}
	}

	if (p_layout->has_section_key("ShaderEditor", "split_offset")) {
		files_split->set_split_offset(p_layout->get_value("ShaderEditor", "split_offset"));
	}

	_update_shader_list();
	_shader_selected(selected_shader_idx, false);

	_set_text_shader_zoom_factor(p_layout->get_value("ShaderEditor", "text_shader_zoom_factor", 1.0f));

	restoring_layout = false;
}

void ShaderEditorPlugin::get_window_layout(Ref<ConfigFile> p_layout) {
	if (p_layout->has_section_key("ShaderEditor", "window_rect")) {
		p_layout->erase_section_key("ShaderEditor", "window_rect");
	}
	if (p_layout->has_section_key("ShaderEditor", "window_screen")) {
		p_layout->erase_section_key("ShaderEditor", "window_screen");
	}
	if (p_layout->has_section_key("ShaderEditor", "window_screen_rect")) {
		p_layout->erase_section_key("ShaderEditor", "window_screen_rect");
	}

	Array shaders;
	String selected_shader;
	for (int i = 0; i < shader_tabs->get_tab_count(); i++) {
		EditedShader edited_shader = edited_shaders[i];
		if (edited_shader.shader_editor) {
			String shader_path;
			if (edited_shader.shader.is_valid()) {
				shader_path = edited_shader.shader->get_path();
			} else {
				DEV_ASSERT(edited_shader.shader_inc.is_valid());
				shader_path = edited_shader.shader_inc->get_path();
			}
			shaders.push_back(shader_path);

			ShaderEditor *shader_editor = Object::cast_to<ShaderEditor>(shader_tabs->get_current_tab_control());

			if (shader_editor && edited_shader.shader_editor == shader_editor) {
				selected_shader = shader_path;
			}
		}
	}
	p_layout->set_value("ShaderEditor", "open_shaders", shaders);
	p_layout->set_value("ShaderEditor", "split_offset", files_split->get_split_offset());
	p_layout->set_value("ShaderEditor", "selected_shader", selected_shader);
	p_layout->set_value("ShaderEditor", "text_shader_zoom_factor", text_shader_zoom_factor);

Review comment (suggestion):
This is unnecessary, the leftovers are harmless.
You should wrap it in `#ifndef DISABLE_DEPRECATED` at least.

Code after:
		}
	}

	if (p_layout->has_section_key("ShaderEditor", "split_offset")) {
		files_split->set_split_offset(p_layout->get_value("ShaderEditor", "split_offset"));
	}

	_update_shader_list();
	_shader_selected(selected_shader_idx, false);

	_set_text_shader_zoom_factor(p_layout->get_value("ShaderEditor", "text_shader_zoom_factor", 1.0f));

	restoring_layout = false;
}

void ShaderEditorPlugin::get_window_layout(Ref<ConfigFile> p_layout) {
#ifndef DISABLE_DEPRECATED
	if (p_layout->has_section_key("ShaderEditor", "window_rect")) {
		p_layout->erase_section_key("ShaderEditor", "window_rect");
	}
	if (p_layout->has_section_key("ShaderEditor", "window_screen")) {
		p_layout->erase_section_key("ShaderEditor", "window_screen");
	}
	if (p_layout->has_section_key("ShaderEditor", "window_screen_rect")) {
		p_layout->erase_section_key("ShaderEditor", "window_screen_rect");
	}
#endif

	Array shaders;
	String selected_shader;
	for (int i = 0; i < shader_tabs->get_tab_count(); i++) {
		EditedShader edited_shader = edited_shaders[i];
		if (edited_shader.shader_editor) {
			String shader_path;
			if (edited_shader.shader.is_valid()) {
				shader_path = edited_shader.shader->get_path();
			} else {
				DEV_ASSERT(edited_shader.shader_inc.is_valid());
				shader_path = edited_shader.shader_inc->get_path();
			}
			shaders.push_back(shader_path);

			ShaderEditor *shader_editor = Object::cast_to<ShaderEditor>(shader_tabs->get_current_tab_control());

			if (shader_editor && edited_shader.shader_editor == shader_editor) {
				selected_shader = shader_path;
			}
		}
	}
	p_layout->set_value("ShaderEditor", "open_shaders", shaders);
	p_layout->set_value("ShaderEditor", "split_offset", files_split->get_split_offset());