From 5b4844e71eaa8f1352688b50162ba302cfa9d3a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 30 Mar 2020 11:12:00 +0530 Subject: [PATCH] oops Broke normal completion in previous commit. Delegate should only be used when actual unknown words are present --- kitty/complete.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/complete.py b/kitty/complete.py index 0508ade27..c6e8b81b9 100644 --- a/kitty/complete.py +++ b/kitty/complete.py @@ -56,7 +56,7 @@ class Delegate: self.new_word = new_word def __bool__(self) -> bool: - return self.num_of_unknown_args > 0 + return self.pos > -1 and self.num_of_unknown_args > 0 @property def precommand(self) -> str: @@ -162,7 +162,7 @@ def zsh_output_serializer(ans: Completions) -> str: if ans.delegate: if ans.delegate.num_of_unknown_args == 1 and not ans.delegate.new_word: lines.append('_command_names -e') - elif ans.delegate.precommand not in ('', 'kitty'): + elif ans.delegate.precommand: for i in range(ans.delegate.pos + 1): lines.append('shift words') lines.append('(( CURRENT-- ))')