Skip to content

Commit 91ff4b1

Browse files
committed
docs(CHANGES,MIGRATION): Note split window updates
1 parent de06475 commit 91ff4b1

File tree

3 files changed

+75
-38
lines changed

3 files changed

+75
-38
lines changed

CHANGES

+33
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,39 @@ $ pip install --user --upgrade --pre libtmux
1515

1616
<!-- To maintainers and contributors: Please add notes for the forthcoming version above -->
1717

18+
### Breaking changes
19+
20+
#### Improved new sessions (#532)
21+
22+
- `Session.new_window()` to {meth}`Session.new_window()`
23+
24+
- Learned `direction`, via {class}`~libtmux.constants.WindowDirection`).
25+
26+
#### Improved window splitting (#532)
27+
28+
- `Window.split_window()` to {meth}`Window.split()`
29+
30+
- Deprecate `Window.split_window()`
31+
32+
- `Pane.split_window()` to {meth}`Pane.split()`
33+
34+
- Deprecate `Pane.split_window()`
35+
- Learned `direction`, via {class}`~libtmux.constants.PaneDirection`).
36+
37+
- Deprecate `vertical` and `horizontal` in favor of `direction`.
38+
39+
- Learned `zoom`
40+
41+
#### Tweak: Pane position (#532)
42+
43+
It's now possible to retrieve the position of a pane in a window via a
44+
`bool` helper::
45+
46+
- {attr}`Pane.at_left`
47+
- {attr}`Pane.at_right`
48+
- {attr}`Pane.at_bottom`
49+
- {attr}`Pane.at_right`
50+
1851
### Development
1952

2053
- poetry: 1.7.1 -> 1.8.1

MIGRATION

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ _Detailed migration steps for the next version will be posted here._
2525

2626
<!-- To the maintainers and contributors: please add migration details for the upcoming release here -->
2727

28+
## 0.33.0: Deprecations for splitting (2024-03-03)
29+
30+
### Deprecations (#532)
31+
32+
- `Window.split_window()` to {meth}`Window.split()`
33+
- `Pane.split_window()` to {meth}`Pane.split()`
34+
2835
## 0.31.0: Renaming and command cleanup (2024-02-17)
2936

3037
### Cleanups (#527)

src/libtmux/pane.py

+35-38
Original file line numberDiff line numberDiff line change
@@ -527,59 +527,56 @@ def split(
527527
528528
Examples
529529
--------
530-
>>> pane
531-
Pane(%1 Window(@1 1:..., Session($1 ...)))
530+
>>> (pane.at_left, pane.at_right,
531+
... pane.at_top, pane.at_bottom)
532+
(True, True,
533+
True, True)
532534
533535
>>> new_pane = pane.split()
534536
535-
>>> new_pane
536-
Pane(%2 Window(@1 1:..., Session($1 ...)))
537-
538-
>>> new_pane.at_right
539-
True
540-
541-
>>> new_pane.at_left
542-
True
543-
544-
>>> new_pane.at_top
545-
False
546-
547-
>>> new_pane.at_bottom
548-
True
537+
>>> (new_pane.at_left, new_pane.at_right,
538+
... new_pane.at_top, new_pane.at_bottom)
539+
(True, True,
540+
False, True)
549541
550542
>>> right_pane = pane.split(direction=PaneDirection.Right)
551543
552-
>>> right_pane
553-
Pane(%3 Window(@1 1:..., Session($1 ...)))
554-
555-
>>> right_pane.at_right
556-
True
544+
>>> (right_pane.at_left, right_pane.at_right,
545+
... right_pane.at_top, right_pane.at_bottom)
546+
(False, True,
547+
True, False)
557548
558-
>>> right_pane.at_left
559-
False
549+
>>> left_pane = pane.split(direction=PaneDirection.Left)
560550
561-
>>> right_pane.at_top
562-
True
551+
>>> (left_pane.at_left, left_pane.at_right,
552+
... left_pane.at_top, left_pane.at_bottom)
553+
(True, False,
554+
True, False)
563555
564-
>>> right_pane.at_bottom
565-
False
556+
>>> top_pane = pane.split(direction=PaneDirection.Above)
566557
567-
>>> left_pane = pane.split(direction=PaneDirection.Left)
558+
>>> (top_pane.at_left, top_pane.at_right,
559+
... top_pane.at_top, top_pane.at_bottom)
560+
(False, False,
561+
True, False)
568562
569-
>>> left_pane
570-
Pane(%4 Window(@1 1:..., Session($1 ...)))
563+
>>> pane = session.new_window().active_pane
571564
572-
>>> left_pane.at_right
573-
False
565+
>>> top_pane = pane.split(direction=PaneDirection.Above, full_window_split=True)
574566
575-
>>> left_pane.at_left
576-
True
567+
>>> (top_pane.at_left, top_pane.at_right,
568+
... top_pane.at_top, top_pane.at_bottom)
569+
(True, True,
570+
True, False)
577571
578-
>>> left_pane.at_top
579-
True
572+
>>> bottom_pane = pane.split(
573+
... direction=PaneDirection.Below,
574+
... full_window_split=True)
580575
581-
>>> left_pane.at_bottom
582-
False
576+
>>> (bottom_pane.at_left, bottom_pane.at_right,
577+
... bottom_pane.at_top, bottom_pane.at_bottom)
578+
(True, True,
579+
False, True)
583580
"""
584581
tmux_formats = ["#{pane_id}" + FORMAT_SEPARATOR]
585582

0 commit comments

Comments
 (0)