@@ -48,26 +48,27 @@ struct MoveCommand: Command {
4848) -> Bool {
4949 switch args. boundaries {
5050 case . workspace:
51- return switch args. boundariesAction {
52- case . stop: true
53- case . fail: false
51+ switch args. boundariesAction {
52+ case . stop: return true
53+ case . fail: return false
5454 case . createImplicitContainer:
55- ( createImplicitContainerAndMoveWindow ( window, workspace, direction) , true ) . 1
55+ createImplicitContainerAndMoveWindow ( window, workspace, direction)
56+ return true
5657 }
5758 case . allMonitorsOuterFrame:
5859 guard let ( monitors, index) = window. nodeMonitor? . findRelativeMonitor ( inDirection: direction) else {
5960 return io. err ( " Should never happen. Can't find the current monitor " )
6061 }
6162
62- guard monitors. getOrNil ( atIndex: index) != nil else {
63+ if monitors. indices. contains ( index) {
64+ let moveNodeToMonitorArgs = MoveNodeToMonitorCmdArgs ( target: . direction( direction) )
65+ . copy ( \. windowId, window. windowId)
66+ . copy ( \. focusFollowsWindow, focus. windowOrNil == window)
67+
68+ return MoveNodeToMonitorCommand ( args: moveNodeToMonitorArgs) . run ( env, io)
69+ } else {
6370 return hitAllMonitorsOuterFrameBoundaries ( window, workspace, io, args, direction)
6471 }
65-
66- let moveNodeToMonitorArgs = MoveNodeToMonitorCmdArgs ( target: . direction( direction) )
67- . copy ( \. windowId, window. windowId)
68- . copy ( \. focusFollowsWindow, focus. windowOrNil == window)
69-
70- return MoveNodeToMonitorCommand ( args: moveNodeToMonitorArgs) . run ( env, io)
7172 }
7273}
7374
@@ -79,9 +80,11 @@ struct MoveCommand: Command {
7980 _ direction: CardinalDirection ,
8081) -> Bool {
8182 switch args. boundariesAction {
82- case . stop: true
83- case . fail: false
84- case . createImplicitContainer: ( createImplicitContainerAndMoveWindow ( window, workspace, direction) , true ) . 1
83+ case . stop: return true
84+ case . fail: return false
85+ case . createImplicitContainer:
86+ createImplicitContainerAndMoveWindow ( window, workspace, direction)
87+ return true
8588 }
8689}
8790
0 commit comments