summaryrefslogtreecommitdiff
path: root/lua/telescope
diff options
context:
space:
mode:
authorFabio Manganiello <info@fabiomanganiello.com>2022-03-11 12:49:55 +0100
committerGitHub <noreply@github.com>2022-03-11 12:49:55 +0100
commitc5bf83dc614b14c6926b738a54c6d059de974f75 (patch)
treeb2da24f3c885b3a152f236339c0f19e3a48c562f /lua/telescope
parent1c4cd6cdaa321a50f6a84a6381421d4fda47d767 (diff)
fix: allow Number type should be allowed for option keys (#1782)
* Number type should be allowed for option keys Some extension (e.g. `dap`) use integer numbers for their selector options instead of strings. Before this commit, the interface for these plugins breaks when using `ui-select` with a stack trace like the following: Error detected while processing function StartDebugger: line 33: E5108: Error executing lua .../telescope.nvim/lua/telescope/pickers.lua:1359: Should be string, found: number stack traceback: [C]: in function 'assert' .../.vim/bundle/telescope.nvim/lua/telescope/pickers.lua:1359: in function 'new' ...e-ui-select.nvim/lua/telescope/_extensions/ui-select.lua:22: in function 'pick_one' .../nvim-dap/lua/dap/ui.lua:32: in function 'pick_if_many' .../nvim-dap/lua/dap.lua:225: in function 'select_config_and_run' .../nvim-dap/lua/dap.lua:551: in function 'continue' [string ":lua"]:1: in main chunk * style Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope')
-rw-r--r--lua/telescope/pickers.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index be8e672..0e26781 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -1359,7 +1359,7 @@ pickers.new = function(opts, defaults)
local result = {}
for k, v in pairs(opts) do
- assert(type(k) == "string", "Should be string, opts")
+ assert(type(k) == "string" or type(k) == "number", "Should be string or number, found: " .. type(k))
result[k] = v
end