Fix split pane orientations

- Cmd+D now correctly creates vertical split (side-by-side)
- Cmd+Shift+D creates horizontal split (top-bottom)
- Recreates split view if changing orientation
- Clear distinction between the two split types
This commit is contained in:
2026-01-31 23:35:51 +00:00
parent 9346719807
commit 69fc74ef07
3 changed files with 18 additions and 2 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -543,10 +543,18 @@ class MainWindowController: NSWindowController {
@objc func splitPaneVertically() { @objc func splitPaneVertically() {
guard let currentSession = tabManager.getCurrentSession() else { return } guard let currentSession = tabManager.getCurrentSession() else { return }
// If split view exists with wrong orientation, recreate it
if let existing = splitView, !existing.isVertical {
// Remove and recreate with correct orientation
existing.removeFromSuperview()
splitView = nil
panes = []
}
// Create split view if it doesn't exist // Create split view if it doesn't exist
if splitView == nil { if splitView == nil {
splitView = NSSplitView(frame: contentView.bounds) splitView = NSSplitView(frame: contentView.bounds)
splitView?.isVertical = true splitView?.isVertical = true // Side-by-side (vertical divider)
splitView?.dividerStyle = .thin splitView?.dividerStyle = .thin
splitView?.autoresizingMask = [.width, .height] splitView?.autoresizingMask = [.width, .height]
@@ -577,10 +585,18 @@ class MainWindowController: NSWindowController {
@objc func splitPaneHorizontally() { @objc func splitPaneHorizontally() {
guard let currentSession = tabManager.getCurrentSession() else { return } guard let currentSession = tabManager.getCurrentSession() else { return }
// If split view exists with wrong orientation, recreate it
if let existing = splitView, existing.isVertical {
// Remove and recreate with correct orientation
existing.removeFromSuperview()
splitView = nil
panes = []
}
// Create split view if it doesn't exist // Create split view if it doesn't exist
if splitView == nil { if splitView == nil {
splitView = NSSplitView(frame: contentView.bounds) splitView = NSSplitView(frame: contentView.bounds)
splitView?.isVertical = false splitView?.isVertical = false // Top-bottom (horizontal divider)
splitView?.dividerStyle = .thin splitView?.dividerStyle = .thin
splitView?.autoresizingMask = [.width, .height] splitView?.autoresizingMask = [.width, .height]