fix(tmux): stop layout override after spawn, use configured main pane size
Remove applyLayout(select-layout main-vertical) call after spawn which was destroying grid arrangements by forcing vertical stacking. Now only enforceMainPaneWidth is called, preserving the grid created by manual split directions. Also fix enforceMainPaneWidth to use config's main_pane_size percentage instead of hardcoded 50%.
This commit is contained in:
@@ -72,7 +72,6 @@ export async function executeActionWithDeps(
|
||||
)
|
||||
|
||||
if (result.success) {
|
||||
await deps.applyLayout(ctx.config.layout, ctx.config.main_pane_size)
|
||||
await enforceMainPane(ctx.windowState, ctx.config, deps)
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ describe("executeAction", () => {
|
||||
mockSpawnTmuxPane.mockImplementation(async () => ({ success: true, paneId: "%7" }))
|
||||
})
|
||||
|
||||
test("applies configured tmux layout after successful spawn", async () => {
|
||||
test("enforces main pane width with configured percentage after successful spawn", async () => {
|
||||
// given
|
||||
// when
|
||||
const result = await executeActionWithDeps(
|
||||
@@ -83,8 +83,7 @@ describe("executeAction", () => {
|
||||
|
||||
// then
|
||||
expect(result).toEqual({ success: true, paneId: "%7" })
|
||||
expect(mockApplyLayout).toHaveBeenCalledTimes(1)
|
||||
expect(mockApplyLayout).toHaveBeenCalledWith("main-horizontal", 55)
|
||||
expect(mockApplyLayout).not.toHaveBeenCalled()
|
||||
expect(mockEnforceMainPaneWidth).toHaveBeenCalledTimes(1)
|
||||
expect(mockEnforceMainPaneWidth).toHaveBeenCalledWith("%0", 220, 55)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user