Skip to content

Commit e11f0a8

Browse files
committed
constants(SplitWindowDirection): Add enum and map for split pane directions
1 parent b1944da commit e11f0a8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/libtmux/constants.py

+18
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,21 @@ class NewWindowDirection(enum.Enum):
3232
NewWindowDirection.Before: "-b",
3333
NewWindowDirection.After: "-a",
3434
}
35+
36+
37+
class SplitWindowDirection(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+
SPLIT_WINDOW_DIRECTION_FLAG_MAP: t.Dict[SplitWindowDirection, t.List[str]] = {
47+
# -v is assumed, but for explicitness it is passed
48+
SplitWindowDirection.Above: ["-v", "-b"],
49+
SplitWindowDirection.Below: ["-v"],
50+
SplitWindowDirection.Right: ["-h"],
51+
SplitWindowDirection.Left: ["-h", "-b"],
52+
}

0 commit comments

Comments
 (0)