Mercurial > vim
comparison runtime/doc/vim9.txt @ 21550:b0b57d91671c v8.2.1325
patch 8.2.1325: Vim9: using Vim9 script for autaload not tested
Commit: https://github.com/vim/vim/commit/ea2d8d25718836bf627b67b7fcd28a1e528bb7b9
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 29 22:11:05 2020 +0200
patch 8.2.1325: Vim9: using Vim9 script for autaload not tested
Problem: Vim9: using Vim9 script for autaload not tested.
Solution: Add a test. Update help.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 29 Jul 2020 22:15:05 +0200 |
parents | c7b2ce90c2de |
children | d0c76ce48326 |
comparison
equal
deleted
inserted
replaced
21549:c32589555cc6 | 21550:b0b57d91671c |
---|---|
116 | 116 |
117 Functions and variables are script-local by default ~ | 117 Functions and variables are script-local by default ~ |
118 *vim9-scopes* | 118 *vim9-scopes* |
119 When using `:function` or `:def` to specify a new function at the script level | 119 When using `:function` or `:def` to specify a new function at the script level |
120 in a Vim9 script, the function is local to the script, as if "s:" was | 120 in a Vim9 script, the function is local to the script, as if "s:" was |
121 prefixed. Using the "s:" prefix is optional. | 121 prefixed. Using the "s:" prefix is optional. To define or use a global |
122 | 122 function or variable the "g:" prefix must be used. For functions in an |
123 To define or use a global function or variable the "g:" prefix must be used. | 123 autoload script the "name#" prefix is sufficient. > |
124 def ThisFunction() # script-local | |
125 def s:ThisFunction() # script-local | |
126 def g:ThatFunction() # global | |
127 def scriptname#function() # autoload | |
124 | 128 |
125 When using `:function` or `:def` to specify a new function inside a function, | 129 When using `:function` or `:def` to specify a new function inside a function, |
126 the function is local to the function. It is not possible to define a | 130 the function is local to the function. It is not possible to define a |
127 script-local function inside a function. It is possible to define a global | 131 script-local function inside a function. It is possible to define a global |
128 function, using the "g:" prefix. | 132 function, using the "g:" prefix. |