oops
Broke normal completion in previous commit. Delegate should only be used when actual unknown words are present
This commit is contained in:
parent
66cbbea9bb
commit
5b4844e71e
@ -56,7 +56,7 @@ class Delegate:
|
|||||||
self.new_word = new_word
|
self.new_word = new_word
|
||||||
|
|
||||||
def __bool__(self) -> bool:
|
def __bool__(self) -> bool:
|
||||||
return self.num_of_unknown_args > 0
|
return self.pos > -1 and self.num_of_unknown_args > 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def precommand(self) -> str:
|
def precommand(self) -> str:
|
||||||
@ -162,7 +162,7 @@ def zsh_output_serializer(ans: Completions) -> str:
|
|||||||
if ans.delegate:
|
if ans.delegate:
|
||||||
if ans.delegate.num_of_unknown_args == 1 and not ans.delegate.new_word:
|
if ans.delegate.num_of_unknown_args == 1 and not ans.delegate.new_word:
|
||||||
lines.append('_command_names -e')
|
lines.append('_command_names -e')
|
||||||
elif ans.delegate.precommand not in ('', 'kitty'):
|
elif ans.delegate.precommand:
|
||||||
for i in range(ans.delegate.pos + 1):
|
for i in range(ans.delegate.pos + 1):
|
||||||
lines.append('shift words')
|
lines.append('shift words')
|
||||||
lines.append('(( CURRENT-- ))')
|
lines.append('(( CURRENT-- ))')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user