Skip to content

Commit ac58e79

Browse files
cameronrsudo-tee
authored andcommitted
fix(ui): select_session with vim.ui.select
Was using an old format. Show the title if we have one, otherwise show session.id Fixes #122
1 parent 1621cfa commit ac58e79

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lua/opencode/ui/ui.lua

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,12 @@ function M.select_session(sessions, cb)
200200
vim.ui.select(sessions, {
201201
prompt = '',
202202
format_item = function(session)
203-
local parts = { { session.id } }
203+
local parts = {}
204204

205-
if session.description then
206-
table.insert(parts, session.description)
207-
end
208-
209-
if session.message_count then
210-
table.insert(parts, session.message_count .. ' messages')
205+
if session.title then
206+
table.insert(parts, session.title)
207+
else
208+
table.insert(parts, session.id)
211209
end
212210

213211
local modified = util.format_time(session.modified)

0 commit comments

Comments
 (0)