diff --git a/lua/fittencode/commands.lua b/lua/fittencode/commands.lua index 8417cf6..5837d53 100644 --- a/lua/fittencode/commands.lua +++ b/lua/fittencode/commands.lua @@ -176,7 +176,7 @@ function M.setup() table.remove(actions, 1) return cmd(unpack(actions)) end - Log.debug('Invalid command; fargs: {}', line.fargs) + Log.debug('Invalid command fargs: {}', line.fargs) end, { complete = function(_, line) local args = vim.split(vim.trim(line), '%s+') diff --git a/lua/fittencode/engines/actions/init.lua b/lua/fittencode/engines/actions/init.lua index bfa099e..207c912 100644 --- a/lua/fittencode/engines/actions/init.lua +++ b/lua/fittencode/engines/actions/init.lua @@ -667,18 +667,6 @@ local chat_callbacks = { end, } -function ActionsEngine.setup() - chat = Chat:new(chat_callbacks) - content = Content:new(chat) - tasks = TaskScheduler:new() - tasks:setup() - status = Status:new({ - tag = 'ActionsEngine', - ready_idle = true, - }) - setup_actions_menu() -end - ---@return integer function ActionsEngine.get_status() return status:get_current() @@ -700,4 +688,16 @@ function ActionsEngine.toggle_chat() end end +function ActionsEngine.setup() + chat = Chat:new(chat_callbacks) + content = Content:new(chat) + tasks = TaskScheduler:new() + tasks:setup() + status = Status:new({ + tag = 'ActionsEngine', + ready_idle = true, + }) + setup_actions_menu() +end + return ActionsEngine diff --git a/lua/fittencode/engines/inline/init.lua b/lua/fittencode/engines/inline/init.lua index 7f080c3..c14804e 100644 --- a/lua/fittencode/engines/inline/init.lua +++ b/lua/fittencode/engines/inline/init.lua @@ -523,10 +523,9 @@ local function setup_keymaps() Base.map('i', key, function() local v = KEYS[value] if v == nil then - Log.warn('Invalid keymap value: ', value) return end - if v then + if v[1] then if M.has_suggestions() then M[value]() else diff --git a/lua/fittencode/views/chat.lua b/lua/fittencode/views/chat.lua index f3d4718..1c17a31 100644 --- a/lua/fittencode/views/chat.lua +++ b/lua/fittencode/views/chat.lua @@ -93,7 +93,7 @@ function M:create(opts) for key, value in pairs(opts.keymaps or {}) do Base.map('n', key, function() - if vim.tbl_contains(vim.tbl_keys(FX), value) then + if FX[value] then FX[value]() end end, { buffer = self.buffer })