diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-15 19:57:55 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-15 21:06:17 +0800 |
commit | e9b4f5105100ce2279915bbe1d67d299c294db24 (patch) | |
tree | 6627d2e9579ebbf7de1860488037fba92630f033 /runtime | |
parent | bcc971de15ed540356405f937d640eaffa4a03bb (diff) | |
download | rneovim-e9b4f5105100ce2279915bbe1d67d299c294db24.tar.gz rneovim-e9b4f5105100ce2279915bbe1d67d299c294db24.tar.bz2 rneovim-e9b4f5105100ce2279915bbe1d67d299c294db24.zip |
vim-patch:9.0.0303: it is not easy to get information about a script
Problem: It is not easy to get information about a script.
Solution: Make getscriptinf() return the version. When selecting a specific
script return functions and variables. (Yegappan Lakshmanan,
closes vim/vim#10991)
https://github.com/vim/vim/commit/2f892d8663498c21296ad6661dac1bb8372cfd10
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index e32cac7839..cb05718ab9 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -3578,21 +3578,40 @@ getregtype([{regname}]) *getregtype()* getscriptinfo([{opts}]) *getscriptinfo()* Returns a |List| with information about all the sourced Vim - scripts in the order they were sourced. - - Each item in the returned List is a |Dict| with the following - items: - autoload always set to FALSE. - name vim script file name. - sid script ID |<SID>|. - version vimscript version, always 1 + scripts in the order they were sourced, like what + `:scriptnames` shows. The optional Dict argument {opts} supports the following + optional items: + name Script name match pattern. If specified, + and "sid" is not specified, information about + scripts with name that match the pattern + "name" are returned. + sid Script ID |<SID>|. If specified, only + information about the script with ID "sid" is + returned and "name" is ignored. + + Each item in the returned List is a |Dict| with the following items: - name script name match pattern. If specified, - information about scripts with name - that match the pattern "name" are returned. + autoload Always set to FALSE. + functions List of script-local function names defined in + the script. Present only when a particular + script is specified using the "sid" item in + {opts}. + name Vim script file name. + sid Script ID |<SID>|. + variables A dictionary with the script-local variables. + Present only when the a particular script is + specified using the "sid" item in {opts}. + Note that this is a copy, the value of + script-local variables cannot be changed using + this dictionary. + version Vimscript version, always 1 + Examples: > + :echo getscriptinfo({'name': 'myscript'}) + :echo getscriptinfo({'sid': 15}).variables +< gettabinfo([{tabnr}]) *gettabinfo()* If {tabnr} is not specified, then information about all the tab pages is returned as a |List|. Each List item is a |