Skip to content

Commit 76cec6f

Browse files
committed
constants(PaneDirection): Add enum and map for split-window direction
1 parent 3c086cf commit 76cec6f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/libtmux/constants.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,21 @@ class WindowDirection(enum.Enum):
3232
WindowDirection.Before: "-b",
3333
WindowDirection.After: "-a",
3434
}
35+
36+
37+
class PaneDirection(enum.Enum):
38+
"""Used for *adjustment* in :meth:`Pane.split()`."""
39+
40+
Above = "ABOVE"
41+
Below = "BELOW" # default with no args
42+
Right = "RIGHT"
43+
Left = "LEFT"
44+
45+
46+
PANE_DIRECTION_FLAG_MAP: t.Dict[PaneDirection, t.List[str]] = {
47+
# -v is assumed, but for explicitness it is passed
48+
PaneDirection.Above: ["-v", "-b"],
49+
PaneDirection.Below: ["-v"],
50+
PaneDirection.Right: ["-h"],
51+
PaneDirection.Left: ["-h", "-b"],
52+
}

0 commit comments

Comments
 (0)