mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-30 19:20:53 +02:00
avoid tilde- and parameter-completion in quotes (11407)
This commit is contained in:
parent
0129f41d80
commit
95883d8b95
3 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
2000-05-16 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 11407: Completion/Base/_tilde, Completion/Core/_path_files:
|
||||
avoid tilde- and parameter-completion in quotes
|
||||
|
||||
* 11406: Completion/Base/_arguments: make _arguments take the
|
||||
attempt to add matches as an indication not to do default
|
||||
option-completion
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
# for you or if there are too many of them, you may want to use
|
||||
# `compadd -qS/ - "$friends[@]"' or something like that.
|
||||
|
||||
[[ -n "$compstate[quote]" ]] && return 1
|
||||
|
||||
local expl suf dirs list lines revlines i ret disp nm="$compstate[nmatches]"
|
||||
|
||||
if [[ "$SUFFIX" = */* ]]; then
|
||||
|
|
|
@ -160,7 +160,7 @@ eorig="$orig"
|
|||
|
||||
# Now let's have a closer look at the string to complete.
|
||||
|
||||
if [[ "$pre[1]" = \~ ]]; then
|
||||
if [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
|
||||
# It begins with `~', so remember anything before the first slash to be able
|
||||
# to report it to the completion code. Also get an expanded version of it
|
||||
# (in `realpath'), so that we can generate the matches. Then remove that
|
||||
|
@ -209,7 +209,7 @@ if [[ "$pre[1]" = \~ ]]; then
|
|||
orig="${orig#*/}"
|
||||
donepath=
|
||||
prepaths=( '' )
|
||||
elif [[ "$pre" = *\$*/* ]]; then
|
||||
elif [[ "$pre" = *\$*/* && "$compstate[quote]" != \" ]]; then
|
||||
|
||||
# If there is a parameter expansion in the word from the line, we try
|
||||
# to complete the beast by expanding the prefix and completing anything
|
||||
|
|
Loading…
Reference in a new issue