Files
RedBear-OS/recipes/shells/zsh/source/Completion/Base/Completer/_extensions
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

34 lines
1018 B
Plaintext

#autoload
# This completer completes filename extensions when completing
# after *. or ^*. It can be used anywhere in the completer list
# but if used after _expand, patterns that already match a file
# will be expanded before it is called.
compset -P '(#b)([~$][^/]#/|)(*/|)(\^|)\*.' || return 1
local -aU files
local -a expl suf mfiles
files=( ${(e)~match[1]}${match[2]}*.* ) || return 1
eval set -A files '${(MSI:'{1..${#${(O)files//[^.]/}[1]}}':)files%%.[^/]##}'
files=( ${files:#.<->(.*|)} )
if zstyle -t ":completion:${curcontext}:extensions" prefix-hidden; then
files=( ${files#.} )
else
PREFIX=".$PREFIX"
IPREFIX="${IPREFIX%.}"
fi
zstyle -T ":completion:${curcontext}:extensions" add-space ||
suf=( -S '' )
_description extensions expl 'file extension'
# for an exact match, fail so as to give _expand or _match a chance.
compadd -O mfiles "$expl[@]" -a files
[[ $#mfiles -gt 1 || ${mfiles[1]} != $PREFIX ]] &&
compadd "$expl[@]" "$suf[@]" -a files &&
[[ -z $compstate[exact_string] ]]