Improve UX by not providing yarn completions if no input

Otherwise, the interface would hang while fish processed the output of
`all-the-package-names` and then would ultimately not show any results
anyhow.
This commit is contained in:
Mahmoud Al-Qudsi 2019-01-10 22:33:31 -06:00
parent 34e104ca35
commit 848ca1c1cc

View file

@ -23,8 +23,11 @@ function __yarn_filtered_list_packages
return
end
all-the-package-names | string match -er -- "(?:\\b|_)"(commandline -ct |
# Do not provide any completions if nothing has been entered yet
if string match -r . (commandline -ct)
all-the-package-names | string match -er -- "(?:\\b|_)"(commandline -ct |
string escape --style=regex) | head -n1000
end
end
function __yarn_find_package_json