diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-08-08 10:32:47 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-08-08 10:32:47 +0000 |
commit | 5c90cf1a51b176badb0095a089df132fc5f62746 (patch) | |
tree | d2117774926e1e19959dd0c24f6810a289b050ec /Completion/Core/_path_files | |
parent | 40e4f4c40b8da652eded74fb3c607c2fb289a10f (diff) | |
download | zsh-5c90cf1a51b176badb0095a089df132fc5f62746.tar.gz zsh-5c90cf1a51b176badb0095a089df132fc5f62746.tar.xz zsh-5c90cf1a51b176badb0095a089df132fc5f62746.zip |
more fixes for completion of special characters (quoting) (12565)
Diffstat (limited to 'Completion/Core/_path_files')
-rw-r--r-- | Completion/Core/_path_files | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 8bb00bdf9..23d32cc0f 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -421,7 +421,7 @@ for prepath in "$prepaths[@]"; do # There are more components, so skip over the next components and make a # slash be added. - tmp1=( ${tmp1//(#b)([][()|*?^#~<>\\])/\\${match[1]}} ) + tmp1=( ${tmp1//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} ) tmp2="${(M)tpre##((.|..|)/)##}" if [[ -n "$tmp2" ]]; then skipped="/$tmp2" @@ -470,7 +470,14 @@ for prepath in "$prepaths[@]"; do # it as far as possible. tmp2="$testpath" - compquote tmp1 tmp2 + if [[ -n "$linepath" ]]; then + compquote -p tmp2 tmp1 + elif [[ -n "$tmp2" ]]; then + compquote -p tmp1 + compquote tmp2 + else + compquote tmp1 tmp2 + fi if [[ -n $menu || -z "$compstate[insert]" ]] || ! zstyle -t ":completion:${curcontext}:paths" expand suffix; then @@ -544,7 +551,12 @@ for prepath in "$prepaths[@]"; do tmp4="${testpath#${mid}}" tmp3="${mid%/*/}" tmp2="${${mid%/}##*/}" - compquote tmp4 tmp3 tmp2 tmp1 + if [[ -n "$linepath" ]]; then + compquote -p tmp3 + else + compquote tmp3 + fi + compquote tmp4 tmp2 tmp1 for i in "$tmp1[@]"; do compadd -Qf "$mopts[@]" -p "$linepath$tmp3/" -s "/$tmp4$i" \ -W "$prepath$realpath${mid%/*/}/" \ @@ -559,7 +571,14 @@ for prepath in "$prepaths[@]"; do SUFFIX="${osuf}" fi tmp4="$testpath" - compquote tmp4 tmp1 + if [[ -n "$linepath" ]]; then + compquote -p tmp4 tmp1 + elif [[ -n "$tmp4" ]]; then + compquote -p tmp1 + compquote tmp4 + else + compquote tmp4 tmp1 + fi compadd -Qf "$mopts[@]" -p "$linepath$tmp4" -W "$prepath$realpath$testpath" \ "$pfxsfx[@]" -M "r:|/=* r:|=*" -a tmp1 fi |