zsh-workers
 help / color / mirror / code / Atom feed
2fcfe829ef25572c5405be36c4ead570e9d44ed2 blob 987 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
#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%%.[^/]##}'

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] ]]
debug log:

solving 2fcfe82 ...
found 2fcfe82 in https://inbox.vuxu.org/zsh-workers/29011.1393594448@thecus.kiddle.eu/

applying [1/1] https://inbox.vuxu.org/zsh-workers/29011.1393594448@thecus.kiddle.eu/
diff --git a/Completion/Base/Completer/_extensions b/Completion/Base/Completer/_extensions
new file mode 100644
index 0000000..2fcfe82

Checking patch Completion/Base/Completer/_extensions...
Applied patch Completion/Base/Completer/_extensions cleanly.

index at:
100644 2fcfe829ef25572c5405be36c4ead570e9d44ed2	Completion/Base/Completer/_extensions

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).