summaryrefslogtreecommitdiffstats
path: root/runtime/doc/eval.txt
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2023-11-05 10:45:12 +0100
committerChristian Brabandt <cb@256bit.org>2023-11-05 10:45:49 +0100
commitda4e433dc3bee7fa521df3c7235d49a6732134ef (patch)
tree5eb77e021412749ea1d28f7681679fda2a331b4e /runtime/doc/eval.txt
parentb2a4c110a5d13bc794f4eddb2e88a4e8fe9dfbea (diff)
runtime(doc): document vim-script library function
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r--runtime/doc/eval.txt35
1 files changed, 34 insertions, 1 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e7152bb670..c91145ce73 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 9.0. Last change: 2023 Jun 01
+*eval.txt* For Vim version 9.0. Last change: 2023 Nov 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -36,6 +36,7 @@ a remark is given.
11. No +eval feature |no-eval-feature|
12. The sandbox |eval-sandbox|
13. Textlock |textlock|
+14. Vim script library |vim-script-library|
Testing support is documented in |testing.txt|.
Profiling is documented at |profiling|.
@@ -4801,5 +4802,37 @@ This is not allowed when the textlock is active:
- closing a window or quitting Vim
- etc.
+==============================================================================
+14. Vim script library *vim-script-library*
+
+Vim comes bundled with a Vim script library, that can be used by runtime,
+script authors. Currently, it only includes very few functions, but it may
+grow over time.
+
+The functions are available as |Vim9-script| as well as using legacy vim
+script (to be used for non Vim 9.0 versions and Neovim).
+
+ *dist#vim* *dist#vim9*
+The functions make use of the autoloaded prefix "dist#vim" (for legacy Vim script and
+Neovim) and "dist#vim9" for Vim9 script.
+
+The following functions are available:
+
+dist#vim#IsSafeExecutable(filetype, executable) ~
+dist#vim9#IsSafeExecutable(filetype:string, executable:string): bool ~
+
+This function takes a filetype and an executable and checks whether it is safe
+to execute the given executable. For security reasons users may not want to
+have Vim execute random executables or may have forbidden to do so for
+specific filetypes by setting the "<filetype>_exec" variable (|plugin_exec|).
+
+It returns |true| or |false| to indicate whether the plugin should run the given
+exectuable. It takes the following arguments:
+
+ argument type ~
+
+ filetype string
+ executable string
+
vim:tw=78:ts=8:noet:ft=help:norl: