diff options
author | max397574 <[email protected]> | 2021-10-23 16:41:07 +0200 |
---|---|---|
committer | max397574 <[email protected]> | 2021-10-23 16:41:07 +0200 |
commit | dd8b22b38be10132e6a17d3b3ab9091f2b00e3ae (patch) | |
tree | 4e3150827a47f90219d4ebf5ada62b4c85cffb95 | |
parent | ecc5176ca675f32edcef86dcc40227204ddcebb1 (diff) |
cleanup(functions): 🗑️removed duplicate function
-rw-r--r-- | lua/startup.lua | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lua/startup.lua b/lua/startup.lua index 6ce4878..c68771d 100644 --- a/lua/startup.lua +++ b/lua/startup.lua @@ -163,22 +163,8 @@ local function empty(amount) table.insert(M.lines, { " ", "center", true, "normal" }) end end -function M.mapping_names(mappings) - local mapnames = {} - local length = utils.longest_line(mappings) + 5 - for name, cmd in pairs(mappings) do - if settings.options.mapping_keys then - local space = utils.spaces(length - #cmd[2] - #name) - table.insert(mapnames, name .. space .. cmd[2]) - else - local space = utils.spaces(length - #name) - table.insert(mapnames, name .. space) - end - end - return mapnames -end -local function mapping_names(mappings) +function M.mapping_names(mappings) local mapnames = {} local strings = {} for title, command in pairs(mappings) do @@ -249,13 +235,16 @@ function M.display() elseif options.type == "mapping" then if options.fold_section then section_alignments[vim.trim(options.title)] = options.align - M.sections[vim.trim(options.title)] = mapping_names(options.content) + M.sections[vim.trim(options.title)] = + require("startup").mapping_names( + options.content + ) table.insert( M.lines, { options.title, options.align, false, options.highlight } ) else - for _, line in ipairs(mapping_names(options.content)) do + for _, line in ipairs(require("startup").mapping_names(options.content)) do table.insert( M.lines, { line, options.align, false, options.highlight } |