summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-08-18 10:44:46 +0100
committerPeter Stephenson <pws@zsh.org>2015-08-18 10:44:46 +0100
commit2372daa7550672db3484be91c401ceb76f892a82 (patch)
tree61619e120368162b7f11b3dabb46c6b0df3243bc
parentc239a7bd91d8cfdc8b8aaf42059add04ba4c16c2 (diff)
downloadzsh-2372daa7550672db3484be91c401ceb76f892a82.tar.gz
zsh-2372daa7550672db3484be91c401ceb76f892a82.zip
36216: Simpler handling of UNDO_LIMIT_NO
-rw-r--r--ChangeLog4
-rw-r--r--Doc/Zsh/zle.yo10
2 files changed, 8 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dd37caf9..4b8430d3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-08-18 Peter Stephenson <p.stephenson@samsung.com>
+
+ * Doc/Zsh/zle.yo: Simpler saving of UNDON_LIMT_NO.
+
2015-08-17 Barton E. Schaefer <schaefer@zsh.org>
* 36212: Functions/Zle/narrow-to-region: save and restore HISTNO
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)