@@ -48,26 +48,27 @@ struct MoveCommand: Command {
48
48
) -> Bool {
49
49
switch args. boundaries {
50
50
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
54
54
case . createImplicitContainer:
55
- ( createImplicitContainerAndMoveWindow ( window, workspace, direction) , true ) . 1
55
+ createImplicitContainerAndMoveWindow ( window, workspace, direction)
56
+ return true
56
57
}
57
58
case . allMonitorsOuterFrame:
58
59
guard let ( monitors, index) = window. nodeMonitor? . findRelativeMonitor ( inDirection: direction) else {
59
60
return io. err ( " Should never happen. Can't find the current monitor " )
60
61
}
61
62
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 {
63
70
return hitAllMonitorsOuterFrameBoundaries ( window, workspace, io, args, direction)
64
71
}
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)
71
72
}
72
73
}
73
74
@@ -79,9 +80,11 @@ struct MoveCommand: Command {
79
80
_ direction: CardinalDirection ,
80
81
) -> Bool {
81
82
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
85
88
}
86
89
}
87
90
0 commit comments