1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

37170: suppress global create warning in function

This commit is contained in:
Peter Stephenson 2015-11-20 12:42:35 +00:00
parent 2737ae4a66
commit 4add525883
2 changed files with 8 additions and 5 deletions

View file

@ -1,5 +1,8 @@
2015-11-20 Peter Stephenson <p.stephenson@samsung.com>
* 37170: Functions/Zle/smart-insert-last-word: suppress
WARN_CREATE_GLOBAL for intentional creation of global variables.
* 37168: Src/params.c: no WARN_CREATE_GLOBAL on special parameters.
* 20974: Src/builtin.c, Test/D04parameter.ztst: fix bug

View file

@ -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