1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-26 16:40:29 +01:00

Oliver: 24962: update prompt_oliver_setup with default highlighting

This commit is contained in:
Peter Stephenson 2008-05-07 20:38:51 +00:00
parent 1663a63196
commit 6985a9fba3
2 changed files with 13 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2008-05-07 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 24962: Oliver: Functions/Prompts/prompt_oliver_setup:
update to use zle_highlight default highlighting.
2008-05-07 Peter Stephenson <pws@csr.com> 2008-05-07 Peter Stephenson <pws@csr.com>
* 24959: Src/Zle/compresult.c: ^D's in compctl could cause a * 24959: Src/Zle/compresult.c: ^D's in compctl could cause a

View file

@ -23,21 +23,21 @@ prompt_oliver_setup() {
[[ "${(t)pcolour}" != assoc* ]] && typeset -Ag pcolour [[ "${(t)pcolour}" != assoc* ]] && typeset -Ag pcolour
[[ "${(t)tcolour}" != assoc* ]] && typeset -Ag tcolour [[ "${(t)tcolour}" != assoc* ]] && typeset -Ag tcolour
local pcol=${1:-${pcolour[${HOST:=`hostname`}]:-yellow}} local pcol=${1:-${pcolour[${HOST:=`hostname`}]:-bold}}
local pcolr=$fg[${pcol#bold}] local pcolr=$fg[${pcol#bold}]
[[ $pcol = bold* ]] && pcolr=$bold_color$pcolr [[ $pcol = bold* ]] && pcolr=%B$pcolr
local tcol=${2:-${tcolour[$HOST]:-white}} local tcol=${2:-${tcolour[$HOST]}}
local tcolr=$reset_color$fg[${tcol#bold}] local tcolr="fg=${tcol#bold}"
[[ $tcol = bold* ]] && tcolr=$tcolr$bold_color [[ $tcol = bold* ]] && tcolr=bold,$tcolr
local a host="%m:" user="%n " local a host="%m:" user="%n "
[[ $HOST == (${(j(|))~normal_hosts}) ]] && host="" [[ $HOST == (${(j(|))~normal_hosts}) ]] && host=""
[[ ${USER:-`whoami`} == (root|${(j(|))~normal_users}) ]] && user="" [[ $LOGNAME == (root|${(j(|))~normal_users}) ]] && user=""
PS1="%{$pcolr%}$user$host%~%"'$((COLUMNS-12))'"(l.$prompt_newline. )[%h%1(j.%%%j.)%0(?..:%?)]%# %{$tcolr%}" PS1="%{$pcolr%}$user$host%~%"'$((COLUMNS-12))'"(l.$prompt_newline. )[%h%1(j.%%%j.)%0(?..:%?)]%# %{$reset_color%}" RPS2='<%^'
RPS2='<%^'
PS2='' PS2=''
zle_highlight[(r)default:*]=default:$tcolr
} }
prompt_oliver_setup "$@" prompt_oliver_setup "$@"