Fix a regression that broke completion when using a kitty alias instead of having kitty on PATH

This commit is contained in:
Kovid Goyal 2022-06-08 07:36:09 +05:30
parent 80ad596d3d
commit eee8106f9e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -676,10 +676,11 @@ def find_completions(words: Sequence[str], new_word: bool, entry_points: Iterabl
ans = Completions() ans = Completions()
if not words: if not words:
return ans return ans
if words[0] in ('edit-in-kitty', 'clone-in-kitty'): exe = os.path.basename(words[0])
if exe in ('edit-in-kitty', 'clone-in-kitty'):
complete_launch_wrapper(ans, words[1:], new_word, allow_files=words[0] != 'clone-in-kitty') complete_launch_wrapper(ans, words[1:], new_word, allow_files=words[0] != 'clone-in-kitty')
return ans return ans
if words[0] != 'kitty': if exe != 'kitty':
return ans return ans
words = words[1:] words = words[1:]
if not words or (len(words) == 1 and not new_word): if not words or (len(words) == 1 and not new_word):