mention scope of :lua

Example provided by @clason
pull/29/head
Timothée Sterle 4 years ago committed by Timothée Sterle
parent d28ca94684
commit 31e0b3eba0

@ -218,6 +218,14 @@ print(tbl)
EOF
```
Note: each `:lua` command has its own scope and variables declared with the `local` keyword are not accessible outside of the command. This won't work:
```vim
:lua local foo = 1
:lua print(foo)
" prints 'nil' instead of '1'
```
See also:
- `:help :lua`

@ -215,6 +215,16 @@ Multi-line scripts are possible using heredoc syntax:
EOF
<
Note: each `:lua` command has its own scope and variables declared with
the `local` keyword are not accessible outside of the command. This
won't work:
>
:lua local foo = 1
:lua print(foo)
" prints 'nil' instead of '1'
<
See also:
- |:lua|

Loading…
Cancel
Save