From ce9d10e465acd5a5641778154d176fd737d47eed Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 15 Dec 1999 21:33:36 +0000 Subject: zsh-workers/9067 --- Functions/Zftp/zfinit | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Functions/Zftp/zfinit') diff --git a/Functions/Zftp/zfinit b/Functions/Zftp/zfinit index 256ef1d2f..7179b5e3e 100644 --- a/Functions/Zftp/zfinit +++ b/Functions/Zftp/zfinit @@ -1,10 +1,19 @@ emulate -L zsh -[[ $1 = -n ]] || zmodload -e zftp || zmodload -ia zftp +[[ $1 = -n ]] || zmodload -e zftp || zmodload -ia zftp || return 1 + +if zmodload -i zutil; then + local arr + # Set defaults for styles if none set. + zstyle -g arr ':zftp:*' progress || zstyle ':zftp:*' progress bar + zstyle -g arr ':zftp:*' update || zstyle ':zftp:*' update 1 + zstyle -g arr ':zftp:*' titlebar || zstyle ':zftp:*' titlebar true + if functions chpwd >&/dev/null && ! zstyle -g arr ':zftp:*' chpwd; then + zstyle ':zftp:*' chpwd true + fi -if [[ ${+zfconfig} = 0 ]]; then typeset -gA zfconfig - zfconfig=(progress bar update 1 lastsession default) + zfconfig=(lastsession default) fi alias zfcd='noglob zfcd' @@ -22,7 +31,7 @@ autoload -U zfstat zftp_chpwd zftp_progress zftransfer zftype zfuget zfuput # zftp completions: only use these if new-style completion is not # active. # -if [[ ${#_patcomps} -eq 0 || ${_patcomps[(i)zf*]} -gt ${#_patcomps} ]]; then +if [[ ${#_patcomps} -eq 0 || -z ${_patcomps[(i)zf*]} ]]; then # only way of getting that noglob out of the way: this is unnecessary with # widget-based completion setopt completealiases @@ -55,3 +64,5 @@ if [[ ${#_patcomps} -eq 0 || ${_patcomps[(i)zf*]} -gt ${#_patcomps} ]]; then compctl -s '$(zftp session)' -S : -x 'C[0,*:*]' \ -K zftransfer_match -- zftransfer fi + +return 0 -- cgit 1.4.1