mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 16:50:58 +01:00
18432: Minor miscellany of comments and rationalisations.
This commit is contained in:
parent
7d4014c30a
commit
f713bf4b09
6 changed files with 40 additions and 5 deletions
|
|
@ -75,6 +75,10 @@ if (( ! ${#sessions} )); then
|
|||
print "No connections to spam." >&2
|
||||
return 1
|
||||
fi
|
||||
if (( ! $# )); then
|
||||
print "No commands given." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -n $transmit ]]; then
|
||||
cmd=tcp_send
|
||||
|
|
|
|||
|
|
@ -15,16 +15,24 @@ autoload match-words-by-style
|
|||
|
||||
local curcontext=":zle:$WIDGET" skip
|
||||
local -a matched_words
|
||||
integer count=${NUMERIC:-1}
|
||||
integer count=${NUMERIC:-1} neg
|
||||
|
||||
(( count < 0 )) && (( count = -count, neg = 1 ))
|
||||
|
||||
while (( count-- > 0 )); do
|
||||
match-words-by-style
|
||||
|
||||
[[ -z "$matched_words[2]$matched_words[5]" ]] && return 1
|
||||
|
||||
LBUFFER="$matched_words[1]$matched_words[5]${(j..)matched_words[3,4]}\
|
||||
if (( neg )); then
|
||||
LBUFFER="$matched_words[1]"
|
||||
RBUFFER="$matched_words[5]${(j..)matched_words[3,4]}\
|
||||
$matched_words[2]${(j..)matched_words[6,7]}"
|
||||
else
|
||||
LBUFFER="$matched_words[1]$matched_words[5]${(j..)matched_words[3,4]}\
|
||||
$matched_words[2]"
|
||||
RBUFFER="${(j..)matched_words[6,7]}"
|
||||
RBUFFER="${(j..)matched_words[6,7]}"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue