diff --git a/share/functions/__fish_print_apt_packages.fish b/share/functions/__fish_print_apt_packages.fish index 76c05ef5f..102895b1b 100644 --- a/share/functions/__fish_print_apt_packages.fish +++ b/share/functions/__fish_print_apt_packages.fish @@ -13,25 +13,30 @@ function __fish_print_apt_packages return 1 end - # Do not not use `apt-cache` as it is sometimes inexplicably slow (by multiple orders of magnitude). if not set -q _flag_installed - awk ' -BEGIN { - FS=": " -} - -/^Package/ { - pkg=$2 -} - -/^Description(-[a-zA-Z]+)?:/ { - desc=$2 - if (index(pkg, "'$search_term'") > 0) { - print pkg "\t" desc - } - pkg="" # Prevent multiple description translations from being printed -}' /dev/null | sed -r '/^(Package|Description-?[a-zA-Z_]*):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\x1a/g' | head -n 2500 | string join "" | string replace --all --regex \x1a+ \n | uniq + return 0 else + # Do not not use `apt-cache` as it is sometimes inexplicably slow (by multiple orders of magnitude). awk ' BEGIN { FS=": "