Commit 8092bc73 authored by Frank Terbeck's avatar Frank Terbeck

grmlprompt: Don't Wrap, use pre and post like everything else

parent 68651c22
......@@ -19,7 +19,7 @@ typeset -gA grml_prompt_pre_default \
grml_prompt_pre_default=(
at ''
battery ' '
change-root ''
change-root '('
date '%F{blue}'
grml-chroot '%F{red}'
history '%F{green}'
......@@ -40,7 +40,7 @@ grml_prompt_pre_default=(
grml_prompt_post_default=(
at ''
battery ''
change-root ''
change-root ')'
date '%f'
grml-chroot '%f '
history '%f'
......@@ -196,15 +196,13 @@ grml_theme_add_token: Token `%s'\'' exists! Giving up!\n\n' $name
fi
}
function grml_wrap_reply () {
function grml_reference_parameter () {
emulate -L zsh
local target="$1"
local new="$2"
local left="$3"
local right="$4"
if (( ${+parameters[$new]} )); then
REPLY="${left}${(P)new}${right}"
REPLY="${(P)new}"
else
REPLY=''
fi
......@@ -232,10 +230,10 @@ function grml_prompt_addto () {
else
case $it in
battery)
grml_wrap_reply $target $new '' ''
grml_reference_parameter $target $new
;;
change-root)
grml_wrap_reply $target $new '(' ')'
grml_reference_parameter $target $new
;;
grml-chroot)
if [[ -n ${(P)new} ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment