mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
48214: add file types to _expand completions, so they can be colored through complist
This commit is contained in:
parent
5d0bb152ef
commit
07a30613f0
3 changed files with 28 additions and 4 deletions
|
@ -1,5 +1,9 @@
|
||||||
2021-03-31 Oliver Kiddle <opk@zsh.org>
|
2021-03-31 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* Marlon Richert: 48214: Completion/Base/Completer/_expand,
|
||||||
|
Test/Y01completion.ztst: add file types to _expand completions,
|
||||||
|
so they can be colored through complist
|
||||||
|
|
||||||
* Christian K: 48192: Completion/Unix/Command/_openstack:
|
* Christian K: 48192: Completion/Unix/Command/_openstack:
|
||||||
Fix openstack completion for new style clients
|
Fix openstack completion for new style clients
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ setopt localoptions nonomatch
|
||||||
|
|
||||||
[[ _matcher_num -gt 1 ]] && return 1
|
[[ _matcher_num -gt 1 ]] && return 1
|
||||||
|
|
||||||
local exp word sort expr expl subd suf=" " force opt asp tmp opre pre epre
|
local exp word sort expr expl subd pref suf=" " force opt asp tmp opre pre epre
|
||||||
local continue=0
|
local continue=0
|
||||||
|
|
||||||
(( $# )) &&
|
(( $# )) &&
|
||||||
|
@ -214,9 +214,10 @@ else
|
||||||
normal=( "$normal[@]" "$i" )
|
normal=( "$normal[@]" "$i" )
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
(( $#dir )) && compadd "$expl[@]" -UQ -qS/ -a dir
|
pref="${${word:#[~/]*}:+$PWD}/"
|
||||||
(( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space
|
(( $#dir )) && compadd "$expl[@]" -fW "$pref" -UQ -qS/ -a dir
|
||||||
(( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal
|
(( $#space )) && compadd "$expl[@]" -fW "$pref" -UQ -qS " " -a space
|
||||||
|
(( $#normal )) && compadd "$expl[@]" -fW "$pref" -UQ -qS "" -a normal
|
||||||
fi
|
fi
|
||||||
if _requested all-expansions; then
|
if _requested all-expansions; then
|
||||||
local disp dstr
|
local disp dstr
|
||||||
|
|
|
@ -44,6 +44,25 @@
|
||||||
>line: {: dir1/}{}
|
>line: {: dir1/}{}
|
||||||
>line: {: dir2/}{}
|
>line: {: dir2/}{}
|
||||||
|
|
||||||
|
comptest $': *\t\t\t\t\t\t\t'
|
||||||
|
0:_expand shows file types
|
||||||
|
>line: {: dir1/}{}
|
||||||
|
>DESCRIPTION:{expansions}
|
||||||
|
>DI:{dir1}
|
||||||
|
>DI:{dir2}
|
||||||
|
>FI:{file1}
|
||||||
|
>FI:{file2}
|
||||||
|
>DESCRIPTION:{all expansions}
|
||||||
|
>NO:{dir1 dir2 file1 file2}
|
||||||
|
>DESCRIPTION:{original}
|
||||||
|
>NO:{*}
|
||||||
|
>line: {: dir1/}{}
|
||||||
|
>line: {: dir2/}{}
|
||||||
|
>line: {: file1 }{}
|
||||||
|
>line: {: file2 }{}
|
||||||
|
>line: {: dir1 dir2 file1 file2 }{}
|
||||||
|
>line: {: *}{}
|
||||||
|
|
||||||
comptesteval '_users () { compadd user1 user2 }'
|
comptesteval '_users () { compadd user1 user2 }'
|
||||||
comptest $': ~\t\t\t\t\t'
|
comptest $': ~\t\t\t\t\t'
|
||||||
0:tilde
|
0:tilde
|
||||||
|
|
Loading…
Reference in a new issue