Correct the naming of the window arg to call_remote_control

This commit is contained in:
Kovid Goyal 2023-06-10 09:47:37 +05:30
parent 498963fc7c
commit da1276d84a
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 4 deletions

View file

@ -369,7 +369,7 @@ def handle_result(args: List[str], data: Dict[str, Any], target_window_id: int,
m.append('{}={}'.format(k, v or ''))
if launch_args:
w = boss.window_id_map.get(target_window_id)
boss.call_remote_control(active_window=w, args=tuple(launch_args + ([m] if isinstance(m, str) else m)))
boss.call_remote_control(self_window=w, args=tuple(launch_args + ([m] if isinstance(m, str) else m)))
else:
boss.open_url(m, program, cwd=cwd)

View file

@ -708,7 +708,7 @@ class Boss:
import shlex
self.show_error(_('remote_control mapping failed'), shlex.join(args) + '\n' + str(e))
def call_remote_control(self, active_window: Optional[Window], args: Tuple[str, ...]) -> 'ResponseType':
def call_remote_control(self, self_window: Optional[Window], args: Tuple[str, ...]) -> 'ResponseType':
from .rc.base import PayloadGetter, command_for_name, parse_subcommand_cli
from .remote_control import parse_rc_args
aa = list(args)
@ -730,9 +730,9 @@ class Boss:
try:
if isinstance(payload, types.GeneratorType):
for x in payload:
c.response_from_kitty(self, active_window, PayloadGetter(c, x if isinstance(x, dict) else {}))
c.response_from_kitty(self, self_window, PayloadGetter(c, x if isinstance(x, dict) else {}))
return None
return c.response_from_kitty(self, active_window, PayloadGetter(c, payload if isinstance(payload, dict) else {}))
return c.response_from_kitty(self, self_window, PayloadGetter(c, payload if isinstance(payload, dict) else {}))
except Exception as e:
if silent:
log_error(f'Failed to run remote_control mapping: {aa} with error: {e}')