Skip to content

Implement newWindowForTab - #1743

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Sep 14, 2026
Merged

cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

See #1742

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The File > New Tab/Cmd-T action must be forwarded or its storyboard connection updated.

Pull request overview

Implements new-tab creation through newWindowForTab and moves tab handling to the window controller.

Changes:

  • Overrides newWindowForTab(_:).
  • Moves tab creation logic to EditorWindowController.
  • Removes the relocated menu action.
File summaries
File Summary
MarkEditMac/Sources/Editor/EditorWindowController.swift Handles new-tab requests, but the existing File > New Tab/Cmd-T storyboard connection remains unhandled.
MarkEditMac/Sources/Editor/Controllers/EditorViewController+Menu.swift Removes the previous tab creation action.
Review details

Suppressed comments (1)

MarkEditMac/Sources/Editor/EditorWindowController.swift:67

  • Moving this action off EditorViewController breaks the existing File > New Tab/Cmd-T connection: Main.storyboard still targets createNewTab: at the application First Responder, where the active editor controller previously handled it. EditorWindowController is not that editor responder, so the menu action is now unhandled even though the title-bar button reaches newWindowForTab:. Keep a forwarding action on EditorViewController or retarget/update the storyboard connection.
  @IBAction func createNewTab(_ sender: Any?) {
    let window = window
    let tabbingMode = window?.tabbingMode

    EditorWindow.forcedTabbing = true
    window?.tabbingMode = .preferred
    NSDocumentController.shared.newDocument(sender)
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@cyanzhong
cyanzhong merged commit a0a25aa into main Sep 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants