From e59f7406a565b574caabb77ec8079e0ed180e3a9 Mon Sep 17 00:00:00 2001 From: Greg Hurrell Date: Sat, 27 Aug 2022 12:46:43 +0200 Subject: [PATCH] fix: don't freak out when not passed a `finders` config As reported here: https://github.com/wincent/command-t/issues/393#issuecomment-1229168699 if `options.finders` is not set to (at least an empty) table, we freak out with: lua/wincent/commandt/init.lua:343: bad argument #1 to 'pairs' (table expected, got nil) --- lua/wincent/commandt/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wincent/commandt/init.lua b/lua/wincent/commandt/init.lua index 18d37ac7..905d7eed 100644 --- a/lua/wincent/commandt/init.lua +++ b/lua/wincent/commandt/init.lua @@ -340,7 +340,7 @@ commandt.setup = function(options) require_string('selection_highlight') require_boolean('smart_case') - for name, finder in pairs(options.finders) do + for name, finder in pairs(options.finders or {}) do require_function_or_string('finders.' .. name .. '.command', nil, { finders = { [name] = {