From 625e843525cfd9d763eddcdb01663d4946f3a910 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 4 Feb 2000 16:11:15 +0000 Subject: Initial revision --- Completion/Core/_prefix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Completion/Core/_prefix diff --git a/Completion/Core/_prefix b/Completion/Core/_prefix new file mode 100644 index 000000000..6306b4aa0 --- /dev/null +++ b/Completion/Core/_prefix @@ -0,0 +1,23 @@ +#autoload + +# Try to ignore the suffix. A bit like e-o-c-prefix. + +[[ -n "$SUFFIX" ]] || return 1 + +local curcontext="${curcontext/:[^:]#:/:prefix:}" comp i + +zstyle -a ":completion:${curcontext}:" completer comp || + comp=( "${(@)_completers[1,-${#_completers_left}-1][(R)_prefix,-1]}" ) + +if zstyle -t ":completion:${curcontext}:" add-space; then + ISUFFIX=" $SUFFIX" +else + ISUFFIX="$SUFFIX" +fi +SUFFIX='' + +for i in "$comp[@]"; do + [[ "$i" != _prefix ]] && "$i" && return 0 +done + +return 1 -- cgit 1.4.1