mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-24 17:00:32 +02:00
zsh-3.1.6-bart-8
This commit is contained in:
parent
5a78f7af98
commit
51cb3f0a27
17 changed files with 434 additions and 40 deletions
|
|
@ -5,5 +5,5 @@ DISTFILES_SRC='
|
|||
prompt_fire_setup prompt_suse_setup prompt_blue_setup
|
||||
prompt_green_setup prompt_white_setup prompt_combo_setup
|
||||
prompt_magenta_setup prompt_yellow_setup prompt_cyan_setup
|
||||
prompt_off_setup promptinit
|
||||
prompt_oliver_setup prompt_off_setup promptinit
|
||||
'
|
||||
|
|
|
|||
|
|
@ -106,21 +106,12 @@ Options:
|
|||
}
|
||||
|
||||
prompt () {
|
||||
local -A prompt_opts
|
||||
local opt
|
||||
|
||||
local prompt_opts
|
||||
|
||||
set_prompt "$@"
|
||||
|
||||
# Set prompt options
|
||||
for opt in ${(k)prompt_opts}; do
|
||||
if [[ $prompt_opts[$opt] != (|un)set ]]; then
|
||||
echo "${0##*/}: value of prompt option must be 'set' or 'unset'" >&2
|
||||
return 1
|
||||
else
|
||||
$prompt_opts[$opt]opt prompt$opt
|
||||
fi
|
||||
done
|
||||
|
||||
(( $#prompt_opts )) &&
|
||||
setopt noprompt{bang,cr,percent,subst} prompt${^prompt_opts[@]}
|
||||
}
|
||||
|
||||
promptinit "$@"
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ insert-and-predict () {
|
|||
zle complete-word ${(s.:.)compconfig[predict_completer]}
|
||||
# Decide where to leave the cursor. The dummy loop is used to
|
||||
# get out of that `case'.
|
||||
while true; do
|
||||
repeat 1
|
||||
do
|
||||
case $compconfig[predict_cursor] in
|
||||
(complete)
|
||||
# At the place where the completion left it, if it is after
|
||||
|
|
@ -69,7 +70,8 @@ insert-and-predict () {
|
|||
(key)
|
||||
# Or maybe at the n'th occurrence of the character typed.
|
||||
pos=${BUFFER[(in:nchar:)${KEYS[-1]}]}
|
||||
if [[ pos -gt curs ]]; then
|
||||
if [[ pos -gt curs ]]
|
||||
then
|
||||
CURSOR=$pos
|
||||
break
|
||||
fi
|
||||
|
|
@ -78,7 +80,6 @@ insert-and-predict () {
|
|||
# Or else at the previous position.
|
||||
CURSOR=$curs
|
||||
esac
|
||||
break
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue