async function checkFile(file) {
		if (file.isUnsaved || !file.loaded || file.loading) return;

		if (file.uri) {
			const fs = fsOperation(file.uri);
			const exists = await fs.exists();

			if (!exists && !file.readOnly) {
				file.isUnsaved = true;
				file.uri = null;
				editorManager.onupdate("file-changed");
				editorManager.emit("update", "file-changed");
				await new Promise((resolve) => {
					alert(
						strings.info,
						strings["file has been deleted"].replace("{file}", file.filename),
						resolve,
					);
				});
				return;
			}

			const text = await fs.readFile(file.encoding);
			const loadedText = file.session.getValue();

			if (text !== loadedText) {
				try {
					const confirmation = await confirm(
						strings.warning.toUpperCase(),
						file.filename + strings["file changed"],
					);

					if (!confirmation) return;

					const cursorPos = editor.getCursorPosition();
					editorManager.getFile(file.id, "id")?.makeActive();

					file.markChanged = false;
					file.session.setValue(text);
					editor.gotoLine(cursorPos.row, cursorPos.column);
					editor.renderer.scrollCursorIntoView(cursorPos, 0.5);
				} catch (error) {
					// ignore
				}
			}
		}
	}
Checks a file for changes
@param {EditorFile} file File to check
@returns {Promise<void>}