We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbb846f commit e632470Copy full SHA for e632470
1 file changed
lua/CopilotChat/functions.lua
@@ -166,9 +166,14 @@ function M.enter_input(schema, source)
166
if not schema.required or vim.tbl_contains(schema.required, prop_name) then
167
if cfg.enum then
168
local choices = type(cfg.enum) == 'table' and cfg.enum or cfg.enum(source)
169
- local choice = utils.select(choices, {
170
- prompt = string.format('Select %s> ', prop_name),
171
- })
+ local choice
+ if #choices == 1 then
+ choice = choices[1]
172
+ else
173
+ choice = utils.select(choices, {
174
+ prompt = string.format('Select %s> ', prop_name),
175
+ })
176
+ end
177
178
table.insert(out, choice or '')
179
elseif cfg.type == 'boolean' then
0 commit comments