diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-07-13 20:01:55 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2026-07-13 20:01:55 +0200 |
| commit | fe794153ed3f267bfba13b78fde67b999fe7e600 (patch) | |
| tree | 77901d36212bdfa057773f228bce83ec4137679d /src/gen/gen_api_dispatch.lua | |
| parent | 9982f6e0e4f712aea28d3351f180786d29cf808d (diff) | |
| download | rneovim-fe794153ed3f267bfba13b78fde67b999fe7e600.tar.gz rneovim-fe794153ed3f267bfba13b78fde67b999fe7e600.tar.bz2 rneovim-fe794153ed3f267bfba13b78fde67b999fe7e600.zip | |
feat(docs): mark optional API parameters
Diffstat (limited to 'src/gen/gen_api_dispatch.lua')
| -rw-r--r-- | src/gen/gen_api_dispatch.lua | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gen/gen_api_dispatch.lua b/src/gen/gen_api_dispatch.lua index 990f6f0a01..731a9a0097 100644 --- a/src/gen/gen_api_dispatch.lua +++ b/src/gen/gen_api_dispatch.lua @@ -118,12 +118,7 @@ local function add_function(fn) fn.parameters[#fn.parameters] = nil end -- `opts` (a KeyDict) and every parameter following it are optional: clients may omit them. - for k = 1, #fn.parameters do - if fn.parameters[k][2] == 'opts' and real_type(fn.parameters[k][1]):match('^KeyDict_') then - fn.opts_idx = k - break - end - end + fn.opts_idx = c_grammar.opts_index(fn.parameters) -- Omitted optional param is zero-initialized, which assumes Dict/Array. if fn.opts_idx then for k = fn.opts_idx + 1, #fn.parameters do |