From 94b01be48331af1e00f41bf46bbbb53427b4c371 Mon Sep 17 00:00:00 2001 From: Galen Rowell Date: Mon, 27 Sep 2021 18:01:03 +1000 Subject: [PATCH] fix: `default_config` var `plugin` -> `plugins` instead --- lua/core/default_config.lua | 4 ++-- lua/core/utils.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 052ead7..2e4e860 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -2,7 +2,7 @@ -- use custom/chadrc.lua instead local M = {} -M.options, M.ui, M.mappings, M.plugin = {}, {}, {}, {} +M.options, M.ui, M.mappings, M.plugins = {}, {}, {}, {} -- non plugin normal, available without any plugins M.options = { @@ -99,7 +99,7 @@ M.plugins = { style = "default", }, autosave = false, -- autosave on changed text or insert mode leave - -- timeout to be used for using escape with a key combination, see mappings.plugin.better_escape + -- timeout to be used for using escape with a key combination, see mappings.plugins.better_escape esc_insertmode_timeout = 300, }, default_plugin_config_replace = {}, diff --git a/lua/core/utils.lua b/lua/core/utils.lua index 92928be..188f6a1 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -147,7 +147,7 @@ M.load_config = function(reload) -- these are the table value which will be always prioritiezed to take user config value local to_replace = { - "['mappings']['plugin']['esc_insertmode']", + "['mappings']['plugins']['esc_insertmode']", "['mappings']['terminal']['esc_termmode']", "['mappings']['terminal']['esc_hide_termmode']", } @@ -243,7 +243,7 @@ end -- 1st arg - base table -- 2nd arg - table to merge -- 3rg arg - list of nodes as a table, if the node is found replace the from table2 to result, rather than adding the value --- e.g: merge_table(t1, t2, { ['plugin']['truezen']['mappings'] }) +-- e.g: merge_table(t1, t2, { ['mappings']['plugins']['bufferline'] }) M.merge_table = function(into, from, nodes_to_replace) -- make sure both are table if type(into) ~= "table" or type(from) ~= "table" then @@ -272,7 +272,7 @@ end]] end for _, node in ipairs(nodes_to_replace) do - -- pcall() is a poor workaround for if "['mappings']['plugin']['esc_insertmode']" 'plugin' sub-table does not exist + -- pcall() is a poor workaround for if "['mappings']['plugins']['esc_insertmode']" 'plugins' sub-table does not exist local ok, result = pcall(replace_fn, node) if ok then -- if the node is found then replace