summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/zle.yo15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index ffce54c84..653678eba 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -743,6 +743,21 @@ local scope, like parameters created in a function using tt(local).
Inside completion widgets and traps called while ZLE is active, these
parameters are available read-only.
+Note that the parameters appear as local to any ZLE widget in
+which they appear. Hence if it is desired to override them this needs
+to be done within a nested function:
+
+example(widget-function+LPAR()+RPAR() {
+ # $WIDGET here refers to the special variable
+ # that is local inside widget-function
+ +LPAR()+RPAR() {
+ # This anonymous nested function allows WIDGET
+ # to be used as a local variable. The -h
+ # removes the special status of the variable.
+ local -h WIDGET
+ }
+})
+
startitem()
vindex(BUFFER)
item(tt(BUFFER) (scalar))(