From 9a63d9af8c989b1df757dc781cafe2fda5beeaf0 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sun, 20 Mar 2022 11:55:16 -0700 Subject: docs: restore commands (#1798) --- scripts/docgen.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/docgen.lua b/scripts/docgen.lua index fdb77849..d6dbbef1 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -106,17 +106,18 @@ local function make_lsp_sections() params.commands = make_section(0, '\n\n', { function() - if not template_def.commands or #template_def.commands == 0 then + if not template_def.commands or #vim.tbl_keys(template_def.commands) == 0 then return end - return '**Commands:**\n' .. make_section(0, '\n', { - sorted_map_table(template_def.commands, function(name, def) - if def.description then - return string.format('- %s: %s', name, def.description) - end - return string.format('- %s', name) - end), - }) + return '**Commands:**\n' + .. make_section(0, '\n', { + sorted_map_table(template_def.commands, function(name, def) + if def.description then + return string.format('- %s: %s', name, def.description) + end + return string.format('- %s', name) + end), + }) end, }) -- cgit v1.2.3-70-g09d2