diff options
| author | Barton E. Schaefer <schaefer@zsh.org> | 2016-01-13 19:50:24 -0800 |
|---|---|---|
| committer | Barton E. Schaefer <schaefer@zsh.org> | 2016-01-13 19:50:24 -0800 |
| commit | c275839033b9ad04886c67837daeb5f35eafa709 (patch) | |
| tree | 914abb220822092487334646b72957c697934849 /Functions/Zle | |
| parent | 37590: Invoke zle-line-pre-redraw during isearch. (diff) | |
| download | zsh-c275839033b9ad04886c67837daeb5f35eafa709.tar zsh-c275839033b9ad04886c67837daeb5f35eafa709.tar.gz zsh-c275839033b9ad04886c67837daeb5f35eafa709.tar.bz2 zsh-c275839033b9ad04886c67837daeb5f35eafa709.tar.lz zsh-c275839033b9ad04886c67837daeb5f35eafa709.tar.xz zsh-c275839033b9ad04886c67837daeb5f35eafa709.tar.zst zsh-c275839033b9ad04886c67837daeb5f35eafa709.zip | |
37567: use (Z:n:) to split the buffer into words so line breaks are treated as whitespace
Diffstat (limited to 'Functions/Zle')
| -rw-r--r-- | Functions/Zle/match-words-by-style | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Functions/Zle/match-words-by-style b/Functions/Zle/match-words-by-style index b387828f3..54e019d23 100644 --- a/Functions/Zle/match-words-by-style +++ b/Functions/Zle/match-words-by-style @@ -111,20 +111,20 @@ done case $wordstyle in (*shell*) local bufwords # This splits the line into words as the shell understands them. - bufwords=(${(z)LBUFFER}) + bufwords=(${(Z:n:)LBUFFER}) nwords=${#bufwords} wordpat1="${(q)bufwords[-1]}" # Take substring of RBUFFER to skip over $skip characters # from the cursor position. - bufwords=(${(z)RBUFFER[1+$skip,-1]}) + bufwords=(${(Z:n:)RBUFFER[1+$skip,-1]}) wordpat2="${(q)bufwords[1]}" spacepat='[[:space:]]#' # Assume the words are at the top level, i.e. if we are inside # 'something with spaces' then we need to ignore the embedded # spaces and consider the whole word. - bufwords=(${(z)BUFFER}) + bufwords=(${(Z:n:)BUFFER}) if (( ${#bufwords[$nwords]} > ${#wordpat1} )); then # Yes, we're in the middle of a shell word. # Find out what's in front. |
