Skip to content

Commit cb80530

Browse files
committed
tests(doctests): For Pane.split
1 parent f94523b commit cb80530

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

src/libtmux/pane.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,59 @@ def split(
521521
Cell/row or percentage to occupy with respect to current window.
522522
environment: dict, optional
523523
Environmental variables for new pane. tmux 3.0+ only. Passthrough to ``-e``.
524+
525+
Examples
526+
--------
527+
>>> (pane.at_left, pane.at_right,
528+
... pane.at_top, pane.at_bottom)
529+
(True, True,
530+
True, True)
531+
532+
>>> new_pane = pane.split()
533+
534+
>>> (new_pane.at_left, new_pane.at_right,
535+
... new_pane.at_top, new_pane.at_bottom)
536+
(True, True,
537+
False, True)
538+
539+
>>> right_pane = pane.split(direction=PaneDirection.Right)
540+
541+
>>> (right_pane.at_left, right_pane.at_right,
542+
... right_pane.at_top, right_pane.at_bottom)
543+
(False, True,
544+
True, False)
545+
546+
>>> left_pane = pane.split(direction=PaneDirection.Left)
547+
548+
>>> (left_pane.at_left, left_pane.at_right,
549+
... left_pane.at_top, left_pane.at_bottom)
550+
(True, False,
551+
True, False)
552+
553+
>>> top_pane = pane.split(direction=PaneDirection.Above)
554+
555+
>>> (top_pane.at_left, top_pane.at_right,
556+
... top_pane.at_top, top_pane.at_bottom)
557+
(False, False,
558+
True, False)
559+
560+
>>> pane = session.new_window().active_pane
561+
562+
>>> top_pane = pane.split(direction=PaneDirection.Above, full_window_split=True)
563+
564+
>>> (top_pane.at_left, top_pane.at_right,
565+
... top_pane.at_top, top_pane.at_bottom)
566+
(True, True,
567+
True, False)
568+
569+
>>> bottom_pane = pane.split(
570+
... direction=PaneDirection.Below,
571+
... full_window_split=True)
572+
573+
>>> (bottom_pane.at_left, bottom_pane.at_right,
574+
... bottom_pane.at_top, bottom_pane.at_bottom)
575+
(True, True,
576+
False, True)
524577
"""
525578
tmux_formats = ["#{pane_id}" + FORMAT_SEPARATOR]
526579

0 commit comments

Comments
 (0)