summary refs log tree commit diff
path: root/Functions/Zle/smart-insert-last-word
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-11-20 12:42:35 +0000
committerPeter Stephenson <pws@zsh.org>2015-11-20 12:42:35 +0000
commit4add5258834ffbbf3e26ef25195a90b6004ca0bf (patch)
treef4260f075f2c359de90e96afb2029ecf4a151086 /Functions/Zle/smart-insert-last-word
parent2737ae4a669c37638bc377e85cce9d50281b3bc2 (diff)
downloadzsh-4add5258834ffbbf3e26ef25195a90b6004ca0bf.tar.gz
zsh-4add5258834ffbbf3e26ef25195a90b6004ca0bf.tar.xz
zsh-4add5258834ffbbf3e26ef25195a90b6004ca0bf.zip
37170: suppress global create warning in function
Diffstat (limited to 'Functions/Zle/smart-insert-last-word')
-rw-r--r--Functions/Zle/smart-insert-last-word10
1 files changed, 5 insertions, 5 deletions
diff --git a/Functions/Zle/smart-insert-last-word b/Functions/Zle/smart-insert-last-word
index 67adea760..cf8715dfe 100644
--- a/Functions/Zle/smart-insert-last-word
+++ b/Functions/Zle/smart-insert-last-word
@@ -60,7 +60,7 @@ then
     lcursor=$_ilw_lcursor
 else
     NUMERIC=1
-    _ilw_lcursor=$lcursor
+    typeset -g _ilw_lcursor=$lcursor
 fi
 # Handle the up to three arguments of .insert-last-word
 if (( $+1 ))
@@ -73,8 +73,8 @@ then
     (( NUMERIC )) || LBUFFER[lcursor+1,cursor+1]=''
     numeric=$((-(${2:--numeric})))
 fi
-_ilw_hist=$HISTNO
-_ilw_count=$NUMERIC
+typeset -g _ilw_hist=$HISTNO
+typeset -g _ilw_count=$NUMERIC
 
 if [[ -z "$numeric" ]]
 then
@@ -119,7 +119,7 @@ fi
 (( NUMERIC > $#lastcmd )) && return 1
 
 LBUFFER[lcursor+1,cursor+1]=$lastcmd[-NUMERIC]
-_ilw_cursor=$CURSOR
+typeset -g _ilw_cursor=$CURSOR
 
 # This is necessary to update UNDO_CHANGE_NO immediately
-zle split-undo && _ilw_changeno=$UNDO_CHANGE_NO
+zle split-undo && typeset -g _ilw_changeno=$UNDO_CHANGE_NO