Files
openidea/src/editorWindowBoot.ts
T
Gabriel Gondim 4e8a392fed feat(editor): Open in New Window uses a lightweight editor window (#4368)
Open in New Window on a project file's tab now opens an editor-only window (editor-<parent>-n) instead of a second project workbench. It shares the parent's documents and language servers; unsaved text, caret and selection move with the tab, and the source tab is removed only after the new window reports ready. Files outside the project keep opening a full window.

Review changes: closing the window settles only its own unsaved files (the project window's guard also asked to terminate running processes); Escape no longer closes it; error messages go through the text catalog; the window has its own stylesheet.

Closes #4117

Co-authored-by: GGVidal <52431033+GGVidal@users.noreply.github.com>
2026-11-19 08:36:35 +08:00

25 lines
985 B
TypeScript

import type { ComponentType } from "react";
import { activate as editor } from "./editor/core";
import { activateEditorWindow, EditorWindow } from "./editor/core/EditorWindow";
import { installLocaleSync } from "./features/app/locale";
import { installMenuBridge } from "./features/app/menuBridge";
import { trackRuntimeSettings } from "./features/settings/runtime";
import { installKeyboardDispatcher } from "./platform/keymap";
import { activateList } from "./windowBoot";
/**
* Lightweight editor window of project window `parent`: one file, sharing the
* parent's documents and language servers, with no workbench chrome.
*/
export function bootEditorWindow(parent: string): ComponentType {
activateList("editor window", [
["locale", installLocaleSync],
["settings", trackRuntimeSettings],
["menu", installMenuBridge],
["editor", editor],
["editorWindow", () => activateEditorWindow(parent)],
]);
installKeyboardDispatcher();
return EditorWindow;
}