diff --git a/lua/neogit/buffers/commit_editor/init.lua b/lua/neogit/buffers/commit_editor/init.lua index 6d67f27a3..70345b128 100644 --- a/lua/neogit/buffers/commit_editor/init.lua +++ b/lua/neogit/buffers/commit_editor/init.lua @@ -47,7 +47,7 @@ function M:open() after = function(buffer) local padding = util.max_length(util.flatten(vim.tbl_values(mapping))) local pad_mapping = function(name) - return pad(mapping[name][1], padding) + return pad(mapping[name] and mapping[name][1] or "", padding) end -- stylua: ignore diff --git a/lua/neogit/buffers/rebase_editor/init.lua b/lua/neogit/buffers/rebase_editor/init.lua index 7b7b2c8f3..5201a5a68 100644 --- a/lua/neogit/buffers/rebase_editor/init.lua +++ b/lua/neogit/buffers/rebase_editor/init.lua @@ -58,7 +58,7 @@ function M:open() after = function(buffer) local padding = util.max_length(util.flatten(vim.tbl_values(mapping))) local pad_mapping = function(name) - return pad(mapping[name][1], padding) + return pad(mapping[name] and mapping[name][1] or "", padding) end -- stylua: ignore diff --git a/lua/neogit/config.lua b/lua/neogit/config.lua index 458a97498..a1cdf7838 100644 --- a/lua/neogit/config.lua +++ b/lua/neogit/config.lua @@ -17,12 +17,6 @@ local function get_reversed_maps(tbl) end end - setmetatable(result, { - __index = function() - return { "" } - end, - }) - return result end