mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-12 11:39:33 +02:00
Fix timeout of @ select-window not canceling the visual select
This commit is contained in:
@@ -816,9 +816,11 @@ class Boss:
|
||||
if matched_action is not None:
|
||||
self.dispatch_action(matched_action)
|
||||
|
||||
def visual_window_select_action(self, tab: Tab, callback: Callable[[Optional[Tab], Optional[Window]], None], choose_msg: str) -> None:
|
||||
def cancel_current_visual_select(self) -> None:
|
||||
if self.visual_window_select_active_in_tab_id:
|
||||
self.visual_window_select_action_trigger(self.visual_window_select_active_in_tab_id)
|
||||
|
||||
def visual_window_select_action(self, tab: Tab, callback: Callable[[Optional[Tab], Optional[Window]], None], choose_msg: str) -> None:
|
||||
self.visual_window_select_callback = callback
|
||||
if tab.current_layout.only_active_window_visible:
|
||||
self.select_window_in_tab_using_overlay(tab, choose_msg)
|
||||
|
||||
@@ -217,6 +217,9 @@ class RemoteCommand:
|
||||
def response_from_kitty(self, boss: 'Boss', window: Optional['Window'], payload_get: PayloadGetType) -> ResponseType:
|
||||
raise NotImplementedError()
|
||||
|
||||
def cancel_async_request(self, boss: 'Boss', window: Optional['Window'], payload_get: PayloadGetType) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def cli_params_for(command: RemoteCommand) -> Tuple[Callable[[], str], str, str, str]:
|
||||
return (command.options_spec or '\n').format, command.argspec, command.desc, f'{appname} @ {command.name}'
|
||||
|
||||
@@ -57,5 +57,8 @@ instead of the active tab.
|
||||
break
|
||||
return no_response
|
||||
|
||||
def cancel_async_request(self, boss: 'Boss', window: Optional['Window'], payload_get: PayloadGetType) -> None:
|
||||
boss.cancel_current_visual_select()
|
||||
|
||||
|
||||
select_window = SelectWindow()
|
||||
|
||||
@@ -48,6 +48,7 @@ def handle_cmd(boss: BossType, window: Optional[WindowType], serialized_cmd: str
|
||||
if async_id:
|
||||
if 'cancel_async' in cmd:
|
||||
active_async_requests.pop(async_id, None)
|
||||
c.cancel_async_request(boss, window, PayloadGetter(c, payload))
|
||||
return None
|
||||
active_async_requests[async_id] = monotonic()
|
||||
payload['async_id'] = async_id
|
||||
|
||||
Reference in New Issue
Block a user