From 4657819e80e3493564c0dd7cf16864aa9bf73c69 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 19 Dec 2019 18:17:43 -0800 Subject: gen_vimdoc.py: mpack: collect functions in 1 dict All Nvim API, core Vimscript, and core Lua functions are globally unique, so there is no need for per-module nested dicts. BEFORE (generated mpack structure): [ { "buffer.c": { "nvim__buf_stats": { ... }, ... }, "window.c": { "nvim_win_close": { ... }, ... }, ... } ] AFTER (generated mpack structure): [ { "nvim__buf_stats": { ... }, "nvim_buf_attach": { ... }, "nvim_tabpage_set_var": { ... }, "nvim_ui_attach": { ... }, "nvim_win_close": { ... } } ] --- scripts/gen_vimdoc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/gen_vimdoc.py') diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 676e6b5be9..229a68a462 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -729,7 +729,7 @@ def gen_docs(config): if p.returncode: sys.exit(p.returncode) - fn_maps = {} + fn_map_full = {} # Collects all functions as each module is processed. sections = {} intros = {} sep = '=' * text_width @@ -800,7 +800,7 @@ def gen_docs(config): title = '{} Functions'.format(name) helptag = '*api-{}*'.format(name.lower()) sections[filename] = (title, helptag, doc) - fn_maps[filename] = fn_map + fn_map_full.update(fn_map) if not sections: return @@ -833,7 +833,7 @@ def gen_docs(config): fp.write(docs.encode('utf8')) with open(mpack_file, 'wb') as fp: - fp.write(msgpack.packb(fn_maps, use_bin_type=True)) + fp.write(msgpack.packb(fn_map_full, use_bin_type=True)) shutil.rmtree(output_dir) -- cgit