We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6f1ec5 commit 7350976Copy full SHA for 7350976
1 file changed
lua/opencode/ui/question_window.lua
@@ -92,7 +92,7 @@ end
92
93
local function get_total_options(question_info)
94
local has_other = find_other_option(question_info.options) ~= nil
95
- return has_other and (#question_info.options + 1) or #question_info.options
+ return has_other and #question_info.options or (#question_info.options + 1)
96
end
97
98
---@param option_index number
@@ -131,10 +131,8 @@ function M._answer_with_custom()
131
132
133
local function add_other_if_missing(options)
134
- for _, opt in ipairs(options) do
135
- if opt.label:lower() == 'other' then
136
- return options
137
- end
+ if find_other_option(options) ~= nil then
+ return options
138
139
local result = vim.deepcopy(options)
140
table.insert(result, { label = 'Other', description = 'Type your own answer' })
0 commit comments