feat: allow custom input provider, removing dressing.nvim (#2173)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: yetone <yetoneful@gmail.com>
This commit is contained in:
23
lua/avante/ui/input/providers/native.lua
Normal file
23
lua/avante/ui/input/providers/native.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local M = {}
|
||||
|
||||
---@param input avante.ui.Input
|
||||
function M.show(input)
|
||||
local opts = {
|
||||
prompt = input.title,
|
||||
default = input.default,
|
||||
completion = input.completion,
|
||||
}
|
||||
|
||||
-- Note: Native vim.ui.input doesn't support concealing
|
||||
-- For password input, users should use dressing or snacks providers
|
||||
if input.conceal then
|
||||
vim.notify_once(
|
||||
"Native input provider doesn't support concealed input. Consider using 'dressing' or 'snacks' provider for password input.",
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
end
|
||||
|
||||
vim.ui.input(opts, input.on_submit)
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user