Workspaces named for what they are, capitalised; Reply gains a task panel; Project settings and limits; icon test row
This commit is contained in:
Binary file not shown.
@@ -133,15 +133,18 @@ def open_pane(name, workspace_name, cwd, command, session=None, adopt_existing=F
|
||||
|
||||
|
||||
def arrange(order, session=None):
|
||||
"""Put these panes on workspaces 1..N in this order, and name them.
|
||||
"""Put these panes on workspaces 1..N in this order, and name the workspaces.
|
||||
|
||||
`order` is a list of (pane name, workspace name) pairs. The pane keeps its
|
||||
own name; the workspace gets the name a person reads on the rail.
|
||||
|
||||
TUIOS numbering follows the order panes land in, and closing panes renumbers
|
||||
the rest, so a rebuild can scatter the pages. Moving each pane once, at the
|
||||
end, is what makes the rail readable and stable.
|
||||
"""
|
||||
moved = []
|
||||
for number, name in enumerate(order, start=1):
|
||||
win = next((w for w in windows(session) if (w.get("custom_name") or "") == name), None)
|
||||
for number, (pane, workspace) in enumerate(order, start=1):
|
||||
win = next((w for w in windows(session) if (w.get("custom_name") or "") == pane), None)
|
||||
if win is None:
|
||||
continue
|
||||
if win.get("workspace") != number:
|
||||
@@ -149,8 +152,8 @@ def arrange(order, session=None):
|
||||
["tuios", "move-window", str(number), "-w", win["window_id"], "-s", session or SESSION],
|
||||
capture_output=True, text=True, timeout=30, check=False,
|
||||
)
|
||||
_name_workspace(number, name, session)
|
||||
moved.append((number, name))
|
||||
_name_workspace(number, workspace, session)
|
||||
moved.append((number, workspace))
|
||||
return moved
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user