zsh-workers
 help / color / mirror / code / Atom feed
30db5ab357147667d136b68496a8616705365df8 blob 591 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
27
28
29
30
31
32
33
34
 
emulate -L zsh
setopt extendedglob

autoload -Uz match-words-by-style

local curcontext=":zle:$WIDGET" word done
local -a matched_words
integer count=${NUMERIC:-1}

if (( count < 0 )); then
  (( NUMERIC = -count ))
  zle backward-$WIDGET
  return
fi

while (( count-- )); do
  match-words-by-style

  word="${(j..)matched_words[4,5]}"

  if [[ -n $word ]]; then
    if [[ -n $done || $LASTWIDGET = *kill* ]]; then
      CUTBUFFER="$CUTBUFFER$word"
    else
      zle copy-region-as-kill -- $word
    fi
    RBUFFER=${(j..)matched_words[6,7]}
  else
    return 1
  fi
  done=1
done

return 0
debug log:

solving 30db5ab ...
found 30db5ab 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).