|
1 |
| -*eval.txt* For Vim version 9.0. Last change: 2023 Jun 01 |
| 1 | +*eval.txt* For Vim version 9.0. Last change: 2023 Nov 05 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -36,6 +36,7 @@ a remark is given.
|
36 | 36 | 11. No +eval feature |no-eval-feature|
|
37 | 37 | 12. The sandbox |eval-sandbox|
|
38 | 38 | 13. Textlock |textlock|
|
| 39 | +14. Vim script library |vim-script-library| |
39 | 40 |
|
40 | 41 | Testing support is documented in |testing.txt|.
|
41 | 42 | Profiling is documented at |profiling|.
|
@@ -4801,5 +4802,37 @@ This is not allowed when the textlock is active:
|
4801 | 4802 | - closing a window or quitting Vim
|
4802 | 4803 | - etc.
|
4803 | 4804 |
|
| 4805 | +============================================================================== |
| 4806 | +14. Vim script library *vim-script-library* |
| 4807 | + |
| 4808 | +Vim comes bundled with a Vim script library, that can be used by runtime, |
| 4809 | +script authors. Currently, it only includes very few functions, but it may |
| 4810 | +grow over time. |
| 4811 | + |
| 4812 | +The functions are available as |Vim9-script| as well as using legacy vim |
| 4813 | +script (to be used for non Vim 9.0 versions and Neovim). |
| 4814 | + |
| 4815 | + *dist#vim* *dist#vim9* |
| 4816 | +The functions make use of the autoloaded prefix "dist#vim" (for legacy Vim script and |
| 4817 | +Neovim) and "dist#vim9" for Vim9 script. |
| 4818 | + |
| 4819 | +The following functions are available: |
| 4820 | + |
| 4821 | +dist#vim#IsSafeExecutable(filetype, executable) ~ |
| 4822 | +dist#vim9#IsSafeExecutable(filetype:string, executable:string): bool ~ |
| 4823 | + |
| 4824 | +This function takes a filetype and an executable and checks whether it is safe |
| 4825 | +to execute the given executable. For security reasons users may not want to |
| 4826 | +have Vim execute random executables or may have forbidden to do so for |
| 4827 | +specific filetypes by setting the "<filetype>_exec" variable (|plugin_exec|). |
| 4828 | + |
| 4829 | +It returns |true| or |false| to indicate whether the plugin should run the given |
| 4830 | +exectuable. It takes the following arguments: |
| 4831 | + |
| 4832 | + argument type ~ |
| 4833 | + |
| 4834 | + filetype string |
| 4835 | + executable string |
| 4836 | + |
4804 | 4837 |
|
4805 | 4838 | vim:tw=78:ts=8:noet:ft=help:norl:
|
0 commit comments