From 38a56fc8357b4b006b85041521a68dc9e24e9b6a Mon Sep 17 00:00:00 2001 From: max397574 Date: Tue, 19 Oct 2021 18:36:23 +0200 Subject: =?UTF-8?q?cleanup(sections):=20=F0=9F=97=91=EF=B8=8Fremoved=20typ?= =?UTF-8?q?e=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/startup.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lua') diff --git a/lua/startup.lua b/lua/startup.lua index b442684..d9bb391 100644 --- a/lua/startup.lua +++ b/lua/startup.lua @@ -6,7 +6,6 @@ M.formatted_text = {} M.sections = {} M.open_sections = {} -local section_types = {} local section_alignments = {} local current_section = "" @@ -21,15 +20,11 @@ function M.open_section() vim.api.nvim_buf_set_option(0, "modifiable", true) local line_nr = vim.api.nvim_win_get_cursor(0)[1] local section_name = vim.trim(vim.api.nvim_get_current_line()) - local section_type = section_types[section_name] local section_align = section_alignments[section_name] local section_entries = M.sections[section_name] if section_name == "" then return end - if section_type == "mapping" then - section_entries = require("startup").mapping_names(section_entries) - end section_entries = require("startup").align(section_entries, section_align) for i, section in ipairs(M.open_sections) do if section == section_name then @@ -257,7 +252,6 @@ function M.display() end if options.type == "text" then if options.section then - section_types[vim.trim(options.title)] = "text" section_alignments[vim.trim(options.title)] = options.align M.sections[vim.trim(options.title)] = options.content table.insert( @@ -274,9 +268,8 @@ function M.display() end elseif options.type == "mapping" then if options.section then - section_types[vim.trim(options.title)] = "mapping" section_alignments[vim.trim(options.title)] = options.align - M.sections[vim.trim(options.title)] = options.content + M.sections[vim.trim(options.title)] = mapping_names(options.content) table.insert( M.lines, { options.title, options.align, true, options.highlight } @@ -301,7 +294,6 @@ function M.display() old_files = utils.get_oldfiles(settings.options.oldfiles_amount) end if options.section then - section_types[vim.trim(options.title)] = "oldfiles" section_alignments[vim.trim(options.title)] = options.align M.sections[vim.trim(options.title)] = old_files table.insert( -- cgit v1.2.3