ronantakizawa/codereview-bench huggingface dataset:
Repository: godotengine/godot
File: scene/gui/tree.cpp (C++)

Code before:
}

bool Tree::is_h_scroll_enabled() const {
	return h_scroll_enabled;
}

void Tree::set_v_scroll_enabled(bool p_enable) {
	if (v_scroll_enabled == p_enable) {
		return;
	}

	v_scroll_enabled = p_enable;
	update_minimum_size();
}

bool Tree::is_v_scroll_enabled() const {
	return v_scroll_enabled;
}

void Tree::set_scroll_hint_mode(ScrollHintMode p_mode) {
	ScrollHintMode prev_mode = scroll_hint_mode;
	scroll_hint_mode = p_mode;

	if (scroll_hint_mode != prev_mode) {
		queue_redraw();
	}
}

Tree::ScrollHintMode Tree::get_scroll_hint_mode() const {
	return scroll_hint_mode;
}

void Tree::set_tile_scroll_hint(bool p_enable) {
	bool prev_tile = tile_scroll_hint;
	tile_scroll_hint = p_enable;

	if (tile_scroll_hint != prev_tile) {
		queue_redraw();
	}
}

bool Tree::is_scroll_hint_tiled() {
	return tile_scroll_hint;
}

TreeItem *Tree::_search_item_text(TreeItem *p_at, const String &p_find, int *r_col, bool p_selectable, bool p_backwards) {
	TreeItem *from = p_at;
	TreeItem *loop = nullptr; // Safe-guard against infinite loop.

	while (p_at) {
		for (int i = 0; i < columns.size(); i++) {

Review comment (suggestion):
```suggestion
	if (scroll_hint_mode == p_mode) {
		return;
	}

	scroll_hint_mode = p_mode;
	queue_redraw();
```
Usual format

Code after:
	if (h_scroll_enabled == p_enable) {
		return;
	}

	h_scroll_enabled = p_enable;
	update_minimum_size();
}

bool Tree::is_h_scroll_enabled() const {
	return h_scroll_enabled;
}

void Tree::set_v_scroll_enabled(bool p_enable) {
	if (v_scroll_enabled == p_enable) {
		return;
	}

	v_scroll_enabled = p_enable;
	update_minimum_size();
}

bool Tree::is_v_scroll_enabled() const {
	return v_scroll_enabled;
}

void Tree::set_scroll_hint_mode(ScrollHintMode p_mode) {
	if (scroll_hint_mode == p_mode) {
		return;
	}

	scroll_hint_mode = p_mode;
	queue_redraw();
}

Tree::ScrollHintMode Tree::get_scroll_hint_mode() const {
	return scroll_hint_mode;
}

void Tree::set_tile_scroll_hint(bool p_enable) {
	if (tile_scroll_hint == p_enable) {
		return;
	}

	tile_scroll_hint = p_enable;
	queue_redraw();
}

bool Tree::is_scroll_hint_tiled() {
	return tile_scroll_hint;
}
Repository: godotengine/godot
File: scene/gui/scroll_container.cpp (C++)

Code before:
	return vertical_scroll_mode;
}

int ScrollContainer::get_deadzone() const {
	return deadzone;
}

void ScrollContainer::set_deadzone(int p_deadzone) {
	deadzone = p_deadzone;
}

void ScrollContainer::set_scroll_hint_mode(ScrollHintMode p_mode) {
	if (scroll_hint_mode == p_mode) {
		return;
	}

	scroll_hint_mode = p_mode;
	update_scroll_hints();
}

ScrollContainer::ScrollHintMode ScrollContainer::get_scroll_hint_mode() const {
	return scroll_hint_mode;
}

void ScrollContainer::set_tile_scroll_hint(bool p_enable) {
	if (tile_scroll_hint != p_enable) {
		return;
	}

	tile_scroll_hint = p_enable;
	update_scroll_hints();
}

bool ScrollContainer::is_scroll_hint_tiled() {
	return tile_scroll_hint;
}

bool ScrollContainer::is_following_focus() const {
	return follow_focus;
}

void ScrollContainer::set_follow_focus(bool p_follow) {
	follow_focus = p_follow;
}

PackedStringArray ScrollContainer::get_configuration_warnings() const {
	PackedStringArray warnings = Container::get_configuration_warnings();

	int found = 0;

	for (int i = 0; i < get_child_count(); i++) {

Review comment (suggestion):
```suggestion
	if (tile_scroll_hint == p_enable) {
```
Also looks like this property is never used? Enabling it has no effect.

Code after:

	vertical_scroll_mode = p_mode;
	update_minimum_size();
	queue_sort();
}

ScrollContainer::ScrollMode ScrollContainer::get_vertical_scroll_mode() const {
	return vertical_scroll_mode;
}

int ScrollContainer::get_deadzone() const {
	return deadzone;
}

void ScrollContainer::set_deadzone(int p_deadzone) {
	deadzone = p_deadzone;
}

void ScrollContainer::set_scroll_hint_mode(ScrollHintMode p_mode) {
	if (scroll_hint_mode == p_mode) {
		return;
	}

	scroll_hint_mode = p_mode;
	_update_scroll_hints();
}

ScrollContainer::ScrollHintMode ScrollContainer::get_scroll_hint_mode() const {
	return scroll_hint_mode;
}

void ScrollContainer::set_tile_scroll_hint(bool p_enable) {
	if (tile_scroll_hint == p_enable) {
		return;
	}

	scroll_hint_top_left->set_stretch_mode(p_enable ? TextureRect::STRETCH_TILE : TextureRect::STRETCH_SCALE);
	scroll_hint_bottom_right->set_stretch_mode(p_enable ? TextureRect::STRETCH_TILE : TextureRect::STRETCH_SCALE);

	tile_scroll_hint = p_enable;
}

bool ScrollContainer::is_scroll_hint_tiled() {
	return tile_scroll_hint;
}

bool ScrollContainer::is_following_focus() const {
	return follow_focus;
}

void ScrollContainer::set_follow_focus(bool p_follow) {
Repository: godotengine/godot
File: editor/export/editor_export.cpp (C++)

Code before:
}

void EditorExport::add_export_platform(const Ref<EditorExportPlatform> &p_platform) {
	p_platform->initialize();
	export_platforms.push_back(p_platform);

	should_update_presets = true;
	should_reload_presets = true;
}

void EditorExport::remove_export_platform(const Ref<EditorExportPlatform> &p_platform) {
	export_platforms.erase(p_platform);
	p_platform->cleanup();

	should_update_presets = true;
	should_reload_presets = true;
}

int EditorExport::get_export_platform_count() const {
	return export_platforms.size();
}

int EditorExport::get_export_platform_index_by_name(const String &p_name) {
	for (int i = 0; i < get_export_platform_count(); i++) {
		Ref<EditorExportPlatform> platform = get_export_platform(i);
		if (platform.is_valid() && platform->get_name().casecmp_to(p_name) == 0) {
			return i;
		}
	}
	return -1;
}

bool EditorExport::has_preset_with_name(const String &p_name, int p_exclude_index, int *r_found_index) const {
	for (int i = 0; i < export_presets.size(); i++) {
		if (i == p_exclude_index) {
			continue;
		}
		if (export_presets[i]->get_name() == p_name) {
			if (r_found_index) {
				*r_found_index = i;
			}
			return true;
		}
	}

	return false;
}

Ref<EditorExportPlatform> EditorExport::get_export_platform(int p_idx) {
	ERR_FAIL_INDEX_V(p_idx, export_platforms.size(), Ref<EditorExportPlatform>());


Review comment (suggestion):
All of these changes should just be reverted, they're not relevant to this PR (also it changes `nocasecmp_to` to `casecmp_to`

Code after:
}

void EditorExport::add_export_platform(const Ref<EditorExportPlatform> &p_platform) {
	p_platform->initialize();
	export_platforms.push_back(p_platform);

	should_update_presets = true;
	should_reload_presets = true;
}

void EditorExport::remove_export_platform(const Ref<EditorExportPlatform> &p_platform) {
	export_platforms.erase(p_platform);
	p_platform->cleanup();

	should_update_presets = true;
	should_reload_presets = true;
}

int EditorExport::get_export_platform_count() const {
	return export_platforms.size();
}

int EditorExport::get_export_platform_index_by_name(const String &p_name) {
	for (int j = 0; j < get_export_platform_count(); j++) {
		Ref<EditorExportPlatform> plat = get_export_platform(j);
		if (!plat.is_null() && plat->get_name().nocasecmp_to(p_name) == 0) {
			return j;
		}
	}
	return -1;
}

bool EditorExport::has_preset_with_name(const String &p_name, int p_exclude_index) const {
	for (int i = 0; i < export_presets.size(); i++) {
		if (i == p_exclude_index) {
			continue;
		}
		if (export_presets[i]->get_name() == p_name) {
			return true;
		}
	}

	return false;
}

Ref<EditorExportPlatform> EditorExport::get_export_platform(int p_idx) {
	ERR_FAIL_INDEX_V(p_idx, export_platforms.size(), Ref<EditorExportPlatform>());

	return export_platforms[p_idx];
}
Repository: godotengine/godot
File: editor/docks/scene_tree_dock.cpp (C++)

Code before:
	}

	emit_signal(SNAME("node_created"), p_child);
}

void SceneTreeDock::_create() {
	if (current_option == TOOL_NEW) {
		Node *parent = nullptr;

		if (edited_scene) {
			// If root exists in edited scene
			parent = scene_tree->get_selected();
			if (!parent) {
				parent = edited_scene;
			}

		} else {
			// If no root exist in edited scene
			parent = scene_root;
			ERR_FAIL_NULL(parent);
		}

		_do_create(parent);

	} else if (current_option == TOOL_CHANGE_TYPE) {
		const List<Node *> &selection = editor_selection->get_top_selected_node_list();
		ERR_FAIL_COND(selection.is_empty());

		EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();
		ur->create_action(TTR("Change type of node(s)"), UndoRedo::MERGE_DISABLE, selection.front()->get());

		for (Node *n : selection) {
			ERR_FAIL_NULL(n);

			Variant c = create_dialog->instantiate_selected();

			ERR_FAIL_COND(!c);
			Node *new_node = Object::cast_to<Node>(c);
			ERR_FAIL_NULL(new_node);
			replace_node(n, new_node);
		}

		ur->commit_action(false);
	} else if (current_option == TOOL_REPARENT_TO_NEW_NODE) {
		const List<Node *> selection = editor_selection->get_top_selected_node_list();
		ERR_FAIL_COND(selection.is_empty());

		// Find top level node in selection
		bool only_one_top_node = true;

		Node *first = selection.front()->get();

Review comment (suggestion):
```suggestion
		const List<Node *> selection = editor_selection->get_top_selected_node_list();
```

Code after:
			int path_length = n->get_path_to(scene_root).get_name_count();

			if (top_node != n) {
				if (smaller_path_to_top > path_length) {
					top_node = n;
					smaller_path_to_top = path_length;
					only_one_top_node = true;
					if (center_parent) {
						top_level_nodes.clear();
						top_level_nodes.append(n);
					}
				} else if (smaller_path_to_top == path_length) {
					if (only_one_top_node && top_node->get_parent() != n->get_parent()) {
						only_one_top_node = false;
					}
					if (center_parent) {
						top_level_nodes.append(n);
					}
				}
			}
		}

		Node *parent = nullptr;
		int original_position = -1;
		if (only_one_top_node) {
			parent = top_node->get_parent();
			original_position = top_node->get_index(false);
		} else {
			parent = top_node->get_parent()->get_parent();
		}

		EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
		undo_redo->create_action_for_history(TTR("Reparent to New Node"), editor_data->get_current_edited_scene_history_id());

		Node *last_created = _do_create(parent);

		Vector<Node *> nodes;
		for (Node *E : selection) {
			nodes.push_back(E);
		}

		if (center_parent) {
			// Find parent type and only average positions of relevant nodes.
			Node3D *parent_node_3d = Object::cast_to<Node3D>(last_created);
			if (parent_node_3d) {
				Vector3 position;
				uint32_t node_count = 0;
				for (const Node *node : nodes) {
					const Node3D *node_3d = Object::cast_to<Node3D>(node);
					if (node_3d) {
						position += node_3d->get_global_position();
Repository: godotengine/godot
File: editor/docks/scene_tree_dock.cpp (C++)

Code before:
				break;
			}

			if (!_validate_no_foreign()) {
				break;
			}

			Node *selected = scene_tree->get_selected();
			Node *clipboard_node = node_clipboard.front()->get();
			HashMap<const Node *, Node *> duplimap;
			Node *new_node = clipboard_node->duplicate_from_editor(duplimap);

			if (new_node) {
				EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();
				String old_scene_file_path = selected->get_scene_file_path();
				String new_scene_file_path = clipboard_node->get_scene_file_path();

				bool old_is_scene = !old_scene_file_path.is_empty();
				bool new_is_scene = !new_scene_file_path.is_empty();

				TypedArray<Node> old_childs;

				ur->create_action(TTR("Replace Node"), UndoRedo::MERGE_DISABLE, selected);

				if (old_is_scene) {
					for (Variant &E : selected->get_children()) {
						Node *child = Object::cast_to<Node>(E);
						if (child && child->get_owner() == selected) {
							ur->add_do_method(selected, "remove_child", child);

							selected->remove_child(child);
							old_childs.push_back(child);
						}
					}
				}

				ur->add_do_method(this, "replace_node", selected, new_node, false, false);
				ur->add_do_method(new_node, "set_scene_file_path", new_scene_file_path);
				ur->add_do_reference(new_node);

				if (new_is_scene) {
					for (Variant &E : new_node->get_children()) {
						Node *child = Object::cast_to<Node>(E);
						if (child && child->get_owner() == new_node) {
							ur->add_do_method(new_node, "add_child", child);
							ur->add_undo_method(child, "set_owner", new_node);
							ur->add_do_reference(child);
						}
					}
				}


Review comment (performance):
Any specific reason to use this? The more efficient way would be to use `get_child_count` and `get_child` and is used everywhere else, avoids creating temporaries and storing things

Code after:
		case TOOL_PASTE_AS_REPLACEMENT: {
			if (!profile_allow_editing) {
				break;
			}

			if (node_clipboard.is_empty()) {
				break;
			}

			if (!_validate_no_foreign()) {
				break;
			}

			paste_node_as_replacement();
		} break;
		case TOOL_CHANGE_TYPE: {
			if (!profile_allow_editing) {
				break;
			}

			if (!_validate_no_foreign()) {
				break;
			}

			if (!_validate_no_instance()) {
				break;
			}

			if (reset_create_dialog) {
				create_dialog->set_base_type("Node");
				reset_create_dialog = false;
			}

			Node *selected = scene_tree->get_selected();
			const List<Node *> &top_node_list = editor_selection->get_top_selected_node_list();
			if (!selected && !top_node_list.is_empty()) {
				selected = top_node_list.front()->get();
			}

			if (selected) {
				create_dialog->popup_create(false, true, selected->get_class(), selected->get_name());
			}
		} break;
		case TOOL_EXTEND_SCRIPT: {
			attach_script_to_selected(true);
		} break;
		case TOOL_ATTACH_SCRIPT: {
			attach_script_to_selected(false);
		} break;
		case TOOL_DETACH_SCRIPT: {
			if (!profile_allow_script_editing) {
Repository: godotengine/godot
File: editor/docks/editor_dock_manager.cpp (C++)

Code before:
	// Open dock to its previous location.
	if (p_dock->dock_slot_index != DockConstants::DOCK_SLOT_NONE) {
		TabContainer *slot = dock_slots[p_dock->dock_slot_index].container;
		int tab_index = p_dock->previous_tab_index;
		if (tab_index < 0) {
			tab_index = slot->get_tab_count();
		}
		_move_dock(p_dock, slot, tab_index, p_set_current);
	} else {
		_open_dock_in_window(p_dock, true, true);
		return;
	}

	p_dock->show();
	_update_layout();
}

void EditorDockManager::make_dock_floating(EditorDock *p_dock) {
	ERR_FAIL_NULL(p_dock);
	ERR_FAIL_COND_MSG(!all_docks.has(p_dock), vformat("Cannot make unknown dock '%s' floating.", p_dock->get_display_title()));

	if (p_dock->dock_window) {
		return;
	}

	_open_dock_in_window(p_dock);
}

TabContainer *EditorDockManager::get_dock_tab_container(Control *p_dock) const {
	return Object::cast_to<TabContainer>(p_dock->get_parent());
}

void EditorDockManager::focus_dock(EditorDock *p_dock) {
	ERR_FAIL_NULL(p_dock);
	ERR_FAIL_COND_MSG(!all_docks.has(p_dock), vformat("Cannot focus unknown dock '%s'.", p_dock->get_display_title()));

	if (!p_dock->enabled) {
		return;
	}

	if (!p_dock->is_open) {
		open_dock(p_dock);
	}

	if (p_dock->dock_window) {
		p_dock->get_window()->grab_focus();
		return;
	}

	if (!docks_visible) {
		return;

Review comment (suggestion):
```suggestion
	if (!p_dock->dock_window) {
		_open_dock_in_window(p_dock);
	}
```

Code after:

	// Open dock to its previous location.
	if (p_dock->dock_slot_index != DockConstants::DOCK_SLOT_NONE) {
		TabContainer *slot = dock_slots[p_dock->dock_slot_index].container;
		int tab_index = p_dock->previous_tab_index;
		if (tab_index < 0) {
			tab_index = slot->get_tab_count();
		}
		_move_dock(p_dock, slot, tab_index, p_set_current);
	} else {
		_open_dock_in_window(p_dock, true, true);
		return;
	}

	_update_layout();
}

void EditorDockManager::make_dock_floating(EditorDock *p_dock) {
	ERR_FAIL_NULL(p_dock);
	ERR_FAIL_COND_MSG(!all_docks.has(p_dock), vformat("Cannot make unknown dock '%s' floating.", p_dock->get_display_title()));

	if (!p_dock->dock_window) {
		_open_dock_in_window(p_dock);
	}
}

TabContainer *EditorDockManager::get_dock_tab_container(Control *p_dock) const {
	return Object::cast_to<TabContainer>(p_dock->get_parent());
}

void EditorDockManager::focus_dock(EditorDock *p_dock) {
	ERR_FAIL_NULL(p_dock);
	ERR_FAIL_COND_MSG(!all_docks.has(p_dock), vformat("Cannot focus unknown dock '%s'.", p_dock->get_display_title()));

	if (!p_dock->enabled) {
		return;
	}

	if (!p_dock->is_open) {
		open_dock(p_dock);
	}

	if (p_dock->dock_window) {
		p_dock->get_window()->grab_focus();
		return;
	}

	if (!docks_visible) {
		return;
	}
Repository: godotengine/godot
File: editor/scene/resource_preloader_editor_plugin.cpp (C++)

Code before:

void ResourcePreloaderEditor::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_TRANSLATION_CHANGED: {
			if (preloader) {
				_update_library();
			}
		} break;

		case NOTIFICATION_THEME_CHANGED: {
			load->set_button_icon(get_editor_theme_icon(SNAME("Folder")));
		} break;
	}
}

void ResourcePreloaderEditor::_files_load_request(const Vector<String> &p_paths) {
	for (int i = 0; i < p_paths.size(); i++) {
		const String &path = p_paths[i];

		Ref<Resource> resource;
		resource = ResourceLoader::load(path);

		if (resource.is_null()) {
			dialog->set_text(TTRC("ERROR: Couldn't load resource!"));
			dialog->popup_centered();
			return; /// Beh, should show an error i guess.
		}

		String basename = path.get_file().get_basename();
		String name = basename;
		int counter = 1;
		while (preloader->has_resource(name)) {
			counter++;
			name = basename + " " + itos(counter);
		}

		EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
		undo_redo->create_action(TTR("Add Resource"));
		undo_redo->add_do_method(preloader, "add_resource", name, resource);
		undo_redo->add_undo_method(preloader, "remove_resource", name);
		undo_redo->add_do_method(this, "_update_library");
		undo_redo->add_undo_method(this, "_update_library");
		undo_redo->commit_action();
	}
}

void ResourcePreloaderEditor::_load_pressed() {
	loading_scene = false;

	file->clear_filters();
	List<String> extensions;

Review comment (suggestion):
```suggestion
			return; /// Beh, should show an error I guess.
```

Code after:
void ResourcePreloaderEditor::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_TRANSLATION_CHANGED: {
			if (preloader) {
				_update_library();
			}
		} break;

		case NOTIFICATION_THEME_CHANGED: {
			load->set_button_icon(get_editor_theme_icon(SNAME("Folder")));
		} break;
	}
}

void ResourcePreloaderEditor::_files_load_request(const Vector<String> &p_paths) {
	for (int i = 0; i < p_paths.size(); i++) {
		const String &path = p_paths[i];

		Ref<Resource> resource;
		resource = ResourceLoader::load(path);

		if (resource.is_null()) {
			dialog->set_text(TTRC("ERROR: Couldn't load resource!"));
			dialog->popup_centered();
			return; /// Beh, should show an error I guess.
		}

		String basename = path.get_file().get_basename();
		String name = basename;
		int counter = 1;
		while (preloader->has_resource(name)) {
			counter++;
			name = basename + " " + itos(counter);
		}

		EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
		undo_redo->create_action(TTR("Add Resource"));
		undo_redo->add_do_method(preloader, "add_resource", name, resource);
		undo_redo->add_undo_method(preloader, "remove_resource", name);
		undo_redo->add_do_method(this, "_update_library");
		undo_redo->add_undo_method(this, "_update_library");
		undo_redo->commit_action();
	}
}

void ResourcePreloaderEditor::_load_pressed() {
	loading_scene = false;

	file->clear_filters();
	List<String> extensions;
	ResourceLoader::get_recognized_extensions_for_type("", &extensions);
Repository: godotengine/godot
File: editor/debugger/script_editor_debugger.cpp (C++)

Code before:
	}
}

void ScriptEditorDebugger::_collapse_errors_list() {
	TreeItem *root = error_tree->get_root();
	if (!root) {
		return;
	}

	TreeItem *item = root->get_first_child();
	while (item) {
		item->set_collapsed(true);
		item = item->get_next();
	}
}

void ScriptEditorDebugger::_vmem_item_activated() {
	TreeItem *selected = vmem_tree->get_selected();
	if (!selected) {
		return;
	}
	const String path = selected->get_text(0);
	if (path.is_empty() || !FileAccess::exists(path)) {
		return;
	}
	FileSystemDock::get_singleton()->open_file(path);
}

void ScriptEditorDebugger::_vmem_tree_rmb_selected(const Vector2 &p_pos, MouseButton p_button) {
	if (p_button != MouseButton::RIGHT) {
		return;
	}

	TreeItem *item = vmem_tree->get_selected();
	if (!item) {
		return;
	}

	String path = item->get_text(0);
	if (path.is_empty() || !FileAccess::exists(path)) {
		return;
	}

	vmem_item_menu->clear();
	vmem_item_menu->reset_size();

	vmem_item_menu->add_icon_item(get_editor_theme_icon(SNAME("ShowInFileSystem")),
			TTR("Show in FileSystem"), VMEM_MENU_SHOW_IN_FILESYSTEM);
	vmem_item_menu->add_icon_item(get_editor_theme_icon(SNAME("Filesystem")),
			TTR("Show in File Manager"), VMEM_MENU_SHOW_IN_EXPLORER);


Review comment (suggestion):
You don't need to use FileSystemDock to open the file in the inspector. Hence the method change is unnecessary.

Code after:
void ScriptEditorDebugger::_expand_errors_list() {
	TreeItem *root = error_tree->get_root();
	if (!root) {
		return;
	}

	TreeItem *item = root->get_first_child();
	while (item) {
		item->set_collapsed(false);
		item = item->get_next();
	}
}

void ScriptEditorDebugger::_collapse_errors_list() {
	TreeItem *root = error_tree->get_root();
	if (!root) {
		return;
	}

	TreeItem *item = root->get_first_child();
	while (item) {
		item->set_collapsed(true);
		item = item->get_next();
	}
}

void ScriptEditorDebugger::_vmem_item_activated() {
	TreeItem *selected = vmem_tree->get_selected();
	if (!selected) {
		return;
	}
	const String path = selected->get_text(0);
	if (path.is_empty() || !FileAccess::exists(path)) {
		return;
	}
	FileSystemDock::get_singleton()->navigate_to_path(path);
}

void ScriptEditorDebugger::_vmem_tree_rmb_selected(const Vector2 &p_pos, MouseButton p_button) {
	if (p_button != MouseButton::RIGHT) {
		return;
	}

	TreeItem *item = vmem_tree->get_selected();
	if (!item) {
		return;
	}

	String path = item->get_text(0);
	if (path.is_empty() || !FileAccess::exists(path)) {
		return;