From bacd90ae5256ae5c1a53752f3c8f54addee68951 Mon Sep 17 00:00:00 2001 From: dogisgreat Date: Sun, 27 Oct 2024 08:03:13 -0400 Subject: [PATCH] maintain focus --- chadtree/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chadtree/client.py b/chadtree/client.py index e118bb8d7..45229a21d 100644 --- a/chadtree/client.py +++ b/chadtree/client.py @@ -146,7 +146,8 @@ async def step(method: Method, params: Sequence[Any]) -> None: async with lock: if stage := await handler(state_ref.val, *params): state_ref.val = stage.state - focus_ref.val = stage.focus + if stage.focus: + focus_ref.val = stage.focus event.set() else: assert False, (method, params)