|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /usr/share/zsh/4.3.10/functions/ |
Upload File : |
# See if we can extend the word context to something more specific.
# curcontext must be set to the base context by this point; it
# will be appended to directly.
emulate -L zsh
setopt extendedglob
local -a worcon bufwords
local pat tag lastword word backword forword
integer iword
zstyle -a $curcontext word-context worcon || return 0
if (( ${#worcon} % 2 )); then
zle -M "Bad word-context style in context $curcontext"
return
fi
bufwords=(${(z)LBUFFER})
iword=${#bufwords}
lastword=${bufwords[-1]}
bufwords=(${(z)BUFFER})
if [[ $lastword = ${bufwords[iword]} ]]; then
# If the word immediately left of the cursor is complete,
# we're not on it for forward operations.
forword=${bufwords[iword+1]}
else
# We're on a word.
forword=${bufwords[iword]}
fi
backword=${bufwords[iword]}
if [[ $curcontext = *back* ]]; then
word=$backword
else
word=$forword
fi
for pat tag in "${worcon[@]}"; do
if [[ $word = ${~pat} ]]; then
curcontext+=":$tag"
return
fi
done