From 02333ee32e0eeafa7ad73c6735ed04a18bdb3b4a Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 14 Sep 2022 21:44:36 +1000 Subject: [PATCH] fix: forgot an argument that broke this plugin for non-md files #24 --- lua/autolist/config.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/autolist/config.lua b/lua/autolist/config.lua index da0e7e5..e93ffaf 100644 --- a/lua/autolist/config.lua +++ b/lua/autolist/config.lua @@ -86,7 +86,7 @@ local function get_preloaded_pattern(pre) return val end -local function setmap(func, mappings, mode) +local function setmap(func, mappings, ft, mode) for _, map in pairs(mappings) do local args = (map:match("%+%(.*%)") or ""):sub(3, -2) local catch = (map:match("%+%[.*%]") or ""):sub(3, -2) @@ -128,8 +128,8 @@ M.update = function(opts) -- for each filetype in th enabled filetypes for ft, _ in pairs(filetype_lists) do - for func, mappings in pairs(newconf.normal_mappings) do setmap(func, mappings, "nnoremap") end - for func, mappings in pairs(newconf.insert_mappings) do setmap(func, mappings, "inoremap") end + for func, mappings in pairs(newconf.normal_mappings) do setmap(func, mappings, ft, "nnoremap") end + for func, mappings in pairs(newconf.insert_mappings) do setmap(func, mappings, ft, "inoremap") end end end