function switchFile(id) {
		const { id: activeFileId } = manager.activeFile || {};
		if (activeFileId === id) return;

		const file = manager.getFile(id);

		manager.activeFile?.tab.classList.remove("active");

		// Hide previous content if it was non-editor
		if (manager.activeFile?.type !== "editor" && manager.activeFile?.content) {
			manager.activeFile.content.style.display = "none";
		}

		manager.activeFile = file;

		if (file.type === "editor") {
			editor.setSession(file.session);
			editor.setReadOnly(!file.editable || !!file.loading);
			$container.style.display = "block";

			$hScrollbar.hideImmediately();
			$vScrollbar.hideImmediately();

			setVScrollValue();
			if (!appSettings.value.textWrap) {
				setHScrollValue();
			}
		} else {
			$container.style.display = "none";
			if (file.content) {
				file.content.style.display = "block";
				if (!file.content.parentElement) {
					$container.parentElement.appendChild(file.content);
				}
			}
			if (manager.activeFile && manager.activeFile.type === "editor") {
				manager.activeFile.session.selection.clearSelection();
			}
		}

		if (file?.hideQuickTools) {
			root.classList.add("hide-floating-button");
			actions("set-height", { height: 0, save: false });
		} else {
			root.classList.remove("hide-floating-button");
			const quickToolsHeight =
				appSettings.value.quickTools !== undefined
					? appSettings.value.quickTools
					: 1;
			actions("set-height", { height: quickToolsHeight, save: true });
		}

		$header.text = file.filename;
		manager.onupdate("switch-file");
		events.emit("switch-file", file);
	}
Switches the active file in the editor.
@param {string} id - The ID of the file to switch to.