mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-01 21:51:40 +02:00
add original string as match (like in _approximate)
This commit is contained in:
parent
8ce654afb5
commit
c4b8482b94
2 changed files with 17 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
|||
2002-04-04 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 16911: Completion/Base/Completer/_match: add original string as
|
||||
match with original style like in _approximate
|
||||
|
||||
* 16933; based on 16011 (Martin Ebourne) and 16906 (Bart):
|
||||
Functions/Zle/up-line-or-beginning-search,
|
||||
Functions/Zle/down-line-or-beginning-search:
|
||||
|
|
|
@ -22,6 +22,8 @@ tmp="${${:-$PREFIX$SUFFIX}#[~=]}"
|
|||
|
||||
_old_match_string="$PREFIX$SUFFIX$HISTNO"
|
||||
|
||||
_tags matches original
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" match-original orig
|
||||
zstyle -s ":completion:${curcontext}:" insert-unambiguous ins
|
||||
|
||||
|
@ -61,10 +63,19 @@ if (( ! ret )); then
|
|||
# ins=yes compstate[insert]="$ocsi" compstate[pattern_insert]="$ocspi"
|
||||
fi
|
||||
|
||||
[[ "$ins" = (true|yes|on|1) &&
|
||||
$#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] &&
|
||||
compstate[pattern_insert]=unambiguous
|
||||
if [[ "$ins" = (true|yes|on|1) &&
|
||||
$#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]]
|
||||
then
|
||||
compstate[pattern_insert]=unambiguous
|
||||
elif _requested original &&
|
||||
{ [[ compstate[nmatches] -gt 1 ]] ||
|
||||
zstyle -t ":completion:${curcontext}:" original }; then
|
||||
local expl
|
||||
|
||||
_description -V original expl original
|
||||
|
||||
compadd "$expl[@]" -U -Q - "$PREFIX$SUFFIX"
|
||||
fi
|
||||
fi
|
||||
|
||||
return ret
|
||||
|
|
Loading…
Reference in a new issue