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:
@@ -543,10 +543,18 @@ class MainWindowController: NSWindowController {
|
||||
@objc func splitPaneVertically() {
|
||||
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
|
||||
if splitView == nil {
|
||||
splitView = NSSplitView(frame: contentView.bounds)
|
||||
splitView?.isVertical = true
|
||||
splitView?.isVertical = true // Side-by-side (vertical divider)
|
||||
splitView?.dividerStyle = .thin
|
||||
splitView?.autoresizingMask = [.width, .height]
|
||||
|
||||
@@ -577,10 +585,18 @@ class MainWindowController: NSWindowController {
|
||||
@objc func splitPaneHorizontally() {
|
||||
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
|
||||
if splitView == nil {
|
||||
splitView = NSSplitView(frame: contentView.bounds)
|
||||
splitView?.isVertical = false
|
||||
splitView?.isVertical = false // Top-bottom (horizontal divider)
|
||||
splitView?.dividerStyle = .thin
|
||||
splitView?.autoresizingMask = [.width, .height]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user