mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 08:47:47 +02:00
Handle multiple results when invoked from mapping
This commit is contained in:
@@ -157,15 +157,18 @@ def handle_result(args: list[str], data: dict[str, Any], target_window_id: int,
|
|||||||
if not paths:
|
if not paths:
|
||||||
boss.ring_bell_if_allowed()
|
boss.ring_bell_if_allowed()
|
||||||
return
|
return
|
||||||
path = paths[0]
|
|
||||||
w = boss.window_id_map.get(target_window_id)
|
w = boss.window_id_map.get(target_window_id)
|
||||||
if w is not None:
|
if w is not None:
|
||||||
cwd = w.cwd_of_child
|
cwd = w.cwd_of_child
|
||||||
if cwd:
|
items = []
|
||||||
path = relative_path_if_possible(path, cwd)
|
for path in paths:
|
||||||
if w.at_prompt and len(tuple(shlex_split(path))) > 1:
|
if cwd:
|
||||||
path = shlex.quote(path)
|
path = relative_path_if_possible(path, cwd)
|
||||||
w.paste_text(path)
|
if w.at_prompt and len(tuple(shlex_split(path))) > 1:
|
||||||
|
path = shlex.quote(path)
|
||||||
|
items.append(path)
|
||||||
|
text = (' ' if w.at_prompt else '\n').join(items)
|
||||||
|
w.paste_text(text)
|
||||||
|
|
||||||
|
|
||||||
usage = '[directory to start choosing files in]'
|
usage = '[directory to start choosing files in]'
|
||||||
|
|||||||
Reference in New Issue
Block a user