mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 06:24:01 +00:00
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:
parent
34e104ca35
commit
848ca1c1cc
1 changed files with 4 additions and 1 deletions
|
@ -23,9 +23,12 @@ function __yarn_filtered_list_packages
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 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 |
|
all-the-package-names | string match -er -- "(?:\\b|_)"(commandline -ct |
|
||||||
string escape --style=regex) | head -n1000
|
string escape --style=regex) | head -n1000
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function __yarn_find_package_json
|
function __yarn_find_package_json
|
||||||
set parents (__fish_parent_directories (pwd))
|
set parents (__fish_parent_directories (pwd))
|
||||||
|
|
Loading…
Reference in a new issue