zsh-workers
 help / color / mirror / code / Atom feed
90e862da302fa056784fc54d8616f04853677d26 blob 795 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
# Copy the word before the one you last copied --- call repeatedly
# to cycle through the list of words on the history line.
#
# Words in combination with insert-last-word to use the line reached,
# and start from the word before last.  Otherwise, it will operate on
# the current line.

emulate -L zsh
setopt typesetsilent

typeset -g __copyword
if (( ${NUMERIC:-0} )); then
  # 1 means last word, 2 second last, etc.
  (( __copyword = ${NUMERIC:-0} ))
  zstyle -s :$WIDGET widget __copywidget
elif [[ -n $__copyword && $WIDGET = $LASTWIDGET ]]; then
  (( __copyword-- ))
elif [[ $LASTWIDGET = *insert-last-word ]]; then
  __copyword=-2
  typeset -g __copywidget=$LASTWIDGET
else
  __copyword=-1
  zstyle -s :$WIDGET widget __copywidget
fi

zle ${__copywidget:-.insert-last-word} 0 $__copyword
debug log:

solving 90e862da3 ...
found 90e862da3 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).