From ed41dafd3c79ebf2ce390ee9af54fe8bb21deb73 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 3 Feb 2000 17:22:40 +0000 Subject: zsh-workers/9546 --- Functions/Zle/incremental-complete-word | 13 ++++++++----- Functions/Zle/predict-on | 9 ++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'Functions') diff --git a/Functions/Zle/incremental-complete-word b/Functions/Zle/incremental-complete-word index e1020d41a..28e8ea7ac 100644 --- a/Functions/Zle/incremental-complete-word +++ b/Functions/Zle/incremental-complete-word @@ -18,14 +18,17 @@ incremental-complete-word() { local key lbuf="$LBUFFER" rbuf="$RBUFFER" pmpt pstr word local lastl lastr wid twid num alt post toolong - local curcontext="${curcontext}:incremental" stop brk + local curcontext="${curcontext}" stop brk - zstyle -s ":completion${curcontext}" prompt pmpt || + [[ -z "$curcontext" ]] && curcontext=::: + curcontext="${curcontext#*:}incremental:" + + zstyle -s ":completion:${curcontext}" prompt pmpt || pmpt='incremental (%c): %u%s %l' - zstyle -s ":completion${curcontext}" stop stop - zstyle -s ":completion${curcontext}" break brk + zstyle -s ":completion:${curcontext}" stop stop + zstyle -s ":completion:${curcontext}" break brk - if zstyle -t ":completion${curcontext}" list; then + if zstyle -t ":completion:${curcontext}" list; then wid=list-choices post=( icw-list-helper ) else diff --git a/Functions/Zle/predict-on b/Functions/Zle/predict-on index 6e67d5efa..4822c38ce 100644 --- a/Functions/Zle/predict-on +++ b/Functions/Zle/predict-on @@ -53,7 +53,10 @@ insert-and-predict () { unsetopt automenu recexact integer curs=$CURSOR pos nchar=${#LBUFFER//[^${KEYS[-1]}]} local -a +h comppostfuncs - local crs curcontext="${curcontext}:predict" + local crs curcontext="${curcontext}" + + [[ -z "$curcontext" ]] && curcontext=::: + curcontext="${curcontext#*:}predict:" comppostfuncs=( predict-limit-list ) zle complete-word @@ -61,7 +64,7 @@ insert-and-predict () { # get out of that `case'. repeat 1 do - zstyle -s ":completion${curcontext}" cursor crs + zstyle -s ":completion:${curcontext}" cursor crs case $crs in (complete) # At the place where the completion left it, if it is after @@ -119,7 +122,7 @@ predict-limit-list() { then compstate[list]='' compstate[force_list]=yes - elif zstyle -t ":completion:predict${curcontext}" list always + elif zstyle -t ":completion:predict::::" list always then compstate[force_list]=yes fi -- cgit 1.4.1