summaryrefslogtreecommitdiff
path: root/lua/telescope/config
diff options
context:
space:
mode:
authortami5 <kkharji@protonmail.com>2022-03-13 20:11:27 +0300
committerGitHub <noreply@github.com>2022-03-13 18:11:27 +0100
commitef7b6ada6d91a1b2932492d78c730e4fc00cd2ea (patch)
treedda4cb7cb3357724c83e85666bc8dc5c1ee2e898 /lua/telescope/config
parent75b57304323861631519e204d9fbca7bdbf1c4c5 (diff)
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>
Diffstat (limited to 'lua/telescope/config')
-rw-r--r--lua/telescope/config/resolve.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/lua/telescope/config/resolve.lua b/lua/telescope/config/resolve.lua
index 3b47025..3c23406 100644
--- a/lua/telescope/config/resolve.lua
+++ b/lua/telescope/config/resolve.lua
@@ -95,6 +95,10 @@ local get_default = require("telescope.utils").get_default
local resolver = {}
local _resolve_map = {}
+local throw_invalid_config_option = function(key, value)
+ error(string.format("Invalid configuration option for '%s': '%s'", key, tostring(value)), 2)
+end
+
-- Booleans
_resolve_map[function(val)
return val == false
@@ -148,8 +152,7 @@ end] = function(selector, val)
return v(selector, value)
end
end
-
- error("invalid configuration option for padding:" .. tostring(value))
+ throw_invalid_config_option("padding", value)
end
return function(...)
@@ -182,8 +185,7 @@ resolver.resolve_height = function(val)
return v(3, val)
end
end
-
- error("invalid configuration option for height:" .. tostring(val))
+ throw_invalid_config_option("height", val)
end
--- Converts input to a function that returns the width.
@@ -210,7 +212,7 @@ resolver.resolve_width = function(val)
end
end
- error("invalid configuration option for width:" .. tostring(val))
+ throw_invalid_config_option("width", val)
end
--- Calculates the adjustment required to move the picker from the middle of the screen to