diff options
Diffstat (limited to 'lua/telescope/pickers')
| -rw-r--r-- | lua/telescope/pickers/entry_display.lua | 2 | ||||
| -rw-r--r-- | lua/telescope/pickers/layout_strategies.lua | 4 | ||||
| -rw-r--r-- | lua/telescope/pickers/window.lua | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lua/telescope/pickers/entry_display.lua b/lua/telescope/pickers/entry_display.lua index 904641c..937d75e 100644 --- a/lua/telescope/pickers/entry_display.lua +++ b/lua/telescope/pickers/entry_display.lua @@ -39,7 +39,7 @@ entry_display.create = function(configuration) return function(self, picker) local results = {} local highlights = {} - for i = 1, table.getn(generator) do + for i = 1, #generator do if self[i] ~= nil then local str, hl = generator[i](self[i], picker) if hl then diff --git a/lua/telescope/pickers/layout_strategies.lua b/lua/telescope/pickers/layout_strategies.lua index 1483cf9..20e1fc0 100644 --- a/lua/telescope/pickers/layout_strategies.lua +++ b/lua/telescope/pickers/layout_strategies.lua @@ -220,7 +220,7 @@ layout_strategies._format = function(name) table.insert(results, string.format(" - %s", line)) end else - error("Unknown type:" .. type(val)) + error(string.format("expected string or table but found '%s'", type(val))) end end @@ -902,7 +902,7 @@ layout_strategies.bottom_pane = make_documented_layout( results.border = { 1, 1, 0, 1 } end else - error("Unknown prompt_position: " .. tostring(self.window.prompt_position) .. "\n" .. vim.inspect(layout_config)) + error(string.format("Unknown prompt_position: %s\n%s", self.window.prompt_position, vim.inspect(layout_config))) end -- Col diff --git a/lua/telescope/pickers/window.lua b/lua/telescope/pickers/window.lua index 95b89cf..945a7e3 100644 --- a/lua/telescope/pickers/window.lua +++ b/lua/telescope/pickers/window.lua @@ -7,7 +7,7 @@ function p_window.get_window_options(picker, max_columns, max_lines) local getter = require("telescope.pickers.layout_strategies")[layout_strategy] if not getter then - error("Not a valid layout strategy: " .. layout_strategy) + error(string.format("'%s' is not a valid layout strategy", layout_strategy)) end return getter(picker, max_columns, max_lines) |
