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

Code before:

	Dictionary state = editor_data.restore_edited_scene_state(editor_selection, &editor_history);
	_edit_current(true);

	_update_title();
	callable_mp(scene_tabs, &EditorSceneTabs::update_scene_tabs).call_deferred();

	if (tabs_to_close.is_empty()) {
		callable_mp(this, &EditorNode::_set_main_scene_state).call_deferred(state, get_edited_scene()); // Do after everything else is done setting up.
	}

	if (EDITOR_GET("interface/scene_tabs/auto_select_current_scene_file") && !select_current_scene_file_requested) {
		select_current_scene_file_requested = true;
		callable_mp(this, &EditorNode::_nav_to_selected_scene).call_deferred();
	}

	_update_undo_redo_allowed();
	_update_unsaved_cache();
}

void EditorNode::_nav_to_selected_scene() {
	if (!scene_tabs) {
		return;
	}

	FileSystemDock::get_singleton()->navigate_to_path(editor_data.get_scene_path(scene_tabs->get_current_tab()));
	select_current_scene_file_requested = false;
}

void EditorNode::setup_color_picker(ColorPicker *p_picker) {
	p_picker->set_editor_settings(EditorSettings::get_singleton());
	int default_color_mode = EditorSettings::get_singleton()->get_project_metadata("color_picker", "color_mode", EDITOR_GET("interface/inspector/default_color_picker_mode"));
	int picker_shape = EditorSettings::get_singleton()->get_project_metadata("color_picker", "picker_shape", EDITOR_GET("interface/inspector/default_color_picker_shape"));
	bool show_intensity = EditorSettings::get_singleton()->get_project_metadata("color_picker", "show_intensity", EDITOR_GET("interface/inspector/color_picker_show_intensity"));

	p_picker->set_color_mode((ColorPicker::ColorModeType)default_color_mode);
	p_picker->set_picker_shape((ColorPicker::PickerShapeType)picker_shape);
	p_picker->set_edit_intensity(show_intensity);

	p_picker->set_quick_open_callback(callable_mp(this, &EditorNode::_palette_quick_open_dialog));
	p_picker->set_palette_saved_callback(callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::update_file));
	palette_file_selected_callback = callable_mp(p_picker, &ColorPicker::_quick_open_palette_file_selected);
}

bool EditorNode::is_scene_open(const String &p_path) {
	for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
		if (editor_data.get_scene_path(i) == p_path) {
			return true;
		}
	}


Review comment (suggestion):
When empty scene is opened, FileSystem will navigate to `res://`. I'm not sure if this is intended, you should probably check if the path is not empty.

Code after:
		}
	}

	if (editor_data.check_and_update_scene(p_idx)) {
		if (!editor_data.get_scene_path(p_idx).is_empty()) {
			editor_folding.load_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx));
		}

		EditorUndoRedoManager::get_singleton()->clear_history(editor_data.get_scene_history_id(p_idx), false);
	}

	Dictionary state = editor_data.restore_edited_scene_state(editor_selection, &editor_history);
	_edit_current(true);

	_update_title();
	callable_mp(scene_tabs, &EditorSceneTabs::update_scene_tabs).call_deferred();

	if (tabs_to_close.is_empty()) {
		callable_mp(this, &EditorNode::_set_main_scene_state).call_deferred(state, get_edited_scene()); // Do after everything else is done setting up.
	}

	if (!select_current_scene_file_requested && EDITOR_GET("interface/scene_tabs/auto_select_current_scene_file")) {
		select_current_scene_file_requested = true;
		callable_mp(this, &EditorNode::_nav_to_selected_scene).call_deferred();
	}

	_update_undo_redo_allowed();
	_update_unsaved_cache();
}

void EditorNode::_nav_to_selected_scene() {
	select_current_scene_file_requested = false;
	const String scene_path = editor_data.get_scene_path(scene_tabs->get_current_tab());
	if (!scene_path.is_empty()) {
		FileSystemDock::get_singleton()->navigate_to_path(scene_path);
	}
}

void EditorNode::setup_color_picker(ColorPicker *p_picker) {
	p_picker->set_editor_settings(EditorSettings::get_singleton());
	int default_color_mode = EditorSettings::get_singleton()->get_project_metadata("color_picker", "color_mode", EDITOR_GET("interface/inspector/default_color_picker_mode"));
	int picker_shape = EditorSettings::get_singleton()->get_project_metadata("color_picker", "picker_shape", EDITOR_GET("interface/inspector/default_color_picker_shape"));
	bool show_intensity = EDITOR_GET("interface/inspector/color_picker_show_intensity");

	p_picker->set_color_mode((ColorPicker::ColorModeType)default_color_mode);
	p_picker->set_picker_shape((ColorPicker::PickerShapeType)picker_shape);
	p_picker->set_edit_intensity(show_intensity);

	p_picker->set_quick_open_callback(callable_mp(this, &EditorNode::_palette_quick_open_dialog));
	p_picker->set_palette_saved_callback(callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::update_file));
	palette_file_selected_callback = callable_mp(p_picker, &ColorPicker::_quick_open_palette_file_selected);