From 49c0ce9a6204d11ad41091da4cfc22cc57d709ff Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 11 Nov 2019 17:29:58 -0700 Subject: [PATCH] Support layouts with multiple panes of same type --- scripts/wk/tmux.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/wk/tmux.py b/scripts/wk/tmux.py index ad210308..10b3b5a1 100644 --- a/scripts/wk/tmux.py +++ b/scripts/wk/tmux.py @@ -36,13 +36,16 @@ def fix_layout(panes, layout, forced=False): if name not in panes: continue - # Resize pane - pane_id = panes[name] - try: - resize_pane(pane_id, **data) - except RuntimeError: - # Assuming pane was closed just before resizing - pass + # Resize pane(s) + pane_list = panes[name] + if isinstance(pane_list, str): + pane_list = [pane_list] + for pane_id in pane_list: + try: + resize_pane(pane_id, **data) + except RuntimeError: + # Assuming pane was closed just before resizing + pass def get_pane_size(pane_id=None):