feat: improve UX with vim.notify (#1763)

* fix(notify): don't report request on new line

* ref(notify): update message format

* ref(msgs): always quote values + decrease duplication

* fix(ci): undefined variables

* ref(actions): temporary silent actions.__index errors

* cleanup

* revert: panic effort, we continue to use error for those

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
This commit is contained in:
tami5
2022-03-13 20:11:27 +03:00
committed by GitHub
parent 75b5730432
commit ef7b6ada6d
17 changed files with 311 additions and 116 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)