summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorSalomon Popp <hi@salomonpopp.me>2021-11-20 16:07:52 +0100
committerGitHub <noreply@github.com>2021-11-20 16:07:52 +0100
commit6f82c6630cea83b591beeebdc760705cafa3e426 (patch)
treedc447cc4baad807e4d80653b96bed87d31293360 /lua
parentaf5a5803109a3842ec12a3fcea3453292e863544 (diff)
fix: error when opts is nil in pickers.new (#1471)
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/pickers.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index 6b850e9..bda4d53 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -1214,14 +1214,16 @@ function Picker:_do_selection(prompt)
end
pickers.new = function(opts, defaults)
+ opts = opts or {}
+ defaults = defaults or {}
local result = {}
- for k, v in pairs(opts or {}) do
+ for k, v in pairs(opts) do
assert(type(k) == "string", "Should be string, opts")
result[k] = v
end
- for k, v in pairs(defaults or {}) do
+ for k, v in pairs(defaults) do
if result[k] == nil then
assert(type(k) == "string", "Should be string, defaults")
result[k] = v