From dcc6d87c9fd16fa868fe2dffffbf724b7ae71511 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 13 Dec 1999 14:06:30 +0000 Subject: zsh-workers/9020 --- Completion/Core/_path_files | 15 +++++++++++---- Doc/Zsh/compsys.yo | 12 +++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 993d0e89a..cafec3c09 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -224,12 +224,19 @@ for prepath in "$prepaths[@]"; do if [[ "$tpre$tsuf" = */* ]]; then tmp2=( ${^tmp1}*(-/) ) - [[ ! -o globdots && "$PREFIX" = .* ]] && - tmp2=( "$tmp2[@]" ${^tmp1}.*(-/) . .. ) + if [[ ! -o globdots && "$PREFIX" = .* ]]; then + tmp2=( "$tmp2[@]" ${^tmp1}.*(-/) ) + zstyle -t ":completion${curcontext}:paths" special-dirs && + tmp2=( "$tmp2[@]" . .. ) + fi else tmp2=( ${^tmp1}${^~pats} ) - [[ ! -o globdots && "$PREFIX" = .* ]] && - tmp2=( "$tmp2[@]" ${^tmp1}.${^~pats} . .. ) + if [[ ! -o globdots && "$PREFIX" = .* ]]; then + tmp2=( "$tmp2[@]" ${^tmp1}.${^~pats} ) + [[ "$sopt" = */* ]] && + zstyle -t ":completion${curcontext}:paths" special-dirs && + tmp2=( "$tmp2[@]" . .. ) + fi fi tmp1=( "$tmp2[@]" ) diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index ea70421d8..d59a1798e 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -647,7 +647,8 @@ for names of directories in directories from the tt(cdpath) array when completing for the tt(cd) builtin command ) item(tt(paths))( -used to look up the values of the tt(expand) and tt(cursor) styles +used to look up the values of the tt(expand), tt(cursor) and +tt(special-dirs) styles ) item(tt(pods))( for perl pods @@ -1191,6 +1192,11 @@ to tt(menu), then the expansions are only sorted when they are offered as single strings (not in the string containing all possible expansions). ) +item(tt(special-dirs))( +Normally, the completion code will not produce the directory names +tt(.) and tt(..) as possible completions. If this style is set to +`true', it will. +) item(tt(stop))( If set to `true', the tt(_history_complete_word) bindable command will always insert matches as if menucompletion were started @@ -1894,8 +1900,8 @@ These functions also accept the `tt(-J)', `tt(-V)', `tt(-1)', `tt(-2)', `tt(-n)', `tt(-X)', `tt(-M)', `tt(-P)', `tt(-S)', `tt(-q)', `tt(-r)', and `tt(-R)' options from the tt(compadd) builtin. -Finally, the tt(_path_files) function uses the styles tt(expand) and -tt(cursor) with the tt(paths) tag. +Finally, the tt(_path_files) function uses the styles tt(expand), +tt(cursor) and tt(special-dirs) with the tt(paths) tag. ) findex(_parameters) item(tt(_parameters))( -- cgit 1.4.1