From 2372daa7550672db3484be91c401ceb76f892a82 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 18 Aug 2015 10:44:46 +0100 Subject: 36216: Simpler handling of UNDO_LIMIT_NO --- Doc/Zsh/zle.yo | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Doc/Zsh/zle.yo') diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 697b636d8..c06e2260e 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -971,14 +971,12 @@ to use `tt(zle undo) var(change)' in a widget to undo beyond that point; in that case, it will not be possible to undo at all until tt(UNDO_LIMIT_NO) is reduced. Set to 0 to disable the limit. -A typical use of this variable in a widget function is as follows: +A typical use of this variable in a widget function is as follows (note +the additional function scope is required): -example(integer save_limit=$UNDO_LIMIT_NO -UNDO_LIMIT_NO=$UNDO_CHANGE_NO -{ +example(LPAR()RPAR() { + local UNDO_LIMIT_NO=$UNDO_CHANGE_NO # Perform some form of recursive edit. -} always { - UNDO_LIMIT_NO=save_limit }) ) vindex(WIDGET) -- cgit 1.4.1