Skip to content

Commit 4e4be32

Browse files
authored
fix(question_window): avoid duplicate 'other' option (#279)
* fix(question_window): fix wrong total options count * test: regenerate replay snapshots * fix(question_window): avoid duplicate 'other' option * test: regenerate replay snapshots * revert: irrelevant snapshot changes * test: add new replay snapshot * test: skip full session
1 parent 70e3c6f commit 4e4be32

4 files changed

Lines changed: 1092 additions & 4 deletions

File tree

lua/opencode/ui/question_window.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ function M._answer_with_custom()
131131
end
132132

133133
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
134+
if find_other_option(options) ~= nil then
135+
return options
138136
end
139137
local result = vim.deepcopy(options)
140138
table.insert(result, { label = 'Other', description = 'Type your own answer' })

0 commit comments

Comments
 (0)