MCPcopy
hub / github.com/marktext/marktext / _createEditorWindow

Method _createEditorWindow

packages/desktop/src/main/app/index.ts:473–490  ·  view source on GitHub ↗

* Creates a new editor window.

(
    rootDirectory: string | null = null,
    fileList: string[] = [],
    markdownList: string[] = [],
    options: Partial<BrowserWindowConstructorOptions> = {},
    bufferStoreInfo: { id: string; filePath: string | null } | null = null
  )

Source from the content-addressed store, hash-verified

471 * Creates a new editor window.
472 */
473 private _createEditorWindow(
474 rootDirectory: string | null = null,
475 fileList: string[] = [],
476 markdownList: string[] = [],
477 options: Partial<BrowserWindowConstructorOptions> = {},
478 bufferStoreInfo: { id: string; filePath: string | null } | null = null
479 ): EditorWindow {
480 const editor = new EditorWindow(this._accessor)
481 if (rootDirectory) {
482 this._accessor.preferences.setItems({ lastOpenedFolder: rootDirectory })
483 }
484 editor.createWindow(rootDirectory, fileList, markdownList, options, bufferStoreInfo)
485 this._windowManager.add(editor)
486 if (this._windowManager.windowCount === 1) {
487 this._accessor.menu.setActiveWindow(editor.id)
488 }
489 return editor
490 }
491
492 /**
493 * Create a new setting window.

Callers 3

createWindowMethod · 0.95
_openPathListMethod · 0.95
_listenForIpcMainMethod · 0.95

Calls 4

createWindowMethod · 0.95
setActiveWindowMethod · 0.65
setItemsMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected