about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-07-07 09:15:44 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-07-07 09:15:44 +0000
commit1b1712d065fae345cc5658318757348e9fb298d0 (patch)
tree7ef99c888f15dc05231d970af07827cda0af0010
parent11715a9cd832ace6a852fac64ed908cc04de89a6 (diff)
downloadzsh-1b1712d065fae345cc5658318757348e9fb298d0.tar.gz
zsh-1b1712d065fae345cc5658318757348e9fb298d0.tar.xz
zsh-1b1712d065fae345cc5658318757348e9fb298d0.zip
unposted: fix warn_create_global warnings in copy-earlier-word
-rw-r--r--ChangeLog3
-rw-r--r--Functions/Zle/copy-earlier-word4
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index acbc073bd..1a872bc22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-07-07  Peter Stephenson  <pws@csr.com>
 
+	* unposted: Functions/Zle/copy-earlier-word: avoid
+	warnings from WARN_CREATE_GLOBAL.
+
 	* 25269: Frank Terbeck: Src/Zle/compcore.c
 
 2008-07-06  Peter Stephenson  <p.w.stephenson@ntlworld.com>
diff --git a/Functions/Zle/copy-earlier-word b/Functions/Zle/copy-earlier-word
index 63e7edaef..90e862da3 100644
--- a/Functions/Zle/copy-earlier-word
+++ b/Functions/Zle/copy-earlier-word
@@ -6,7 +6,9 @@
 # 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} ))
@@ -15,7 +17,7 @@ elif [[ -n $__copyword && $WIDGET = $LASTWIDGET ]]; then
   (( __copyword-- ))
 elif [[ $LASTWIDGET = *insert-last-word ]]; then
   __copyword=-2
-  __copywidget=$LASTWIDGET
+  typeset -g __copywidget=$LASTWIDGET
 else
   __copyword=-1
   zstyle -s :$WIDGET widget __copywidget