File tree Expand file tree Collapse file tree 5 files changed +26
-8
lines changed Expand file tree Collapse file tree 5 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ require('goose').setup({
81
81
window = {
82
82
submit = ' <cr>' , -- Submit prompt
83
83
close = ' <esc>' , -- Close UI windows
84
- stop = ' <C-c>' , -- Stop a running job
84
+ stop = ' <C-c>' , -- Stop goose while it is running
85
85
next_message = ' ]]' , -- Navigate to next message in the conversation
86
86
prev_message = ' [[' , -- Navigate to previous message in the conversation
87
87
mention_file = ' @' , -- Pick a file and add to context. See File Mentions section
Original file line number Diff line number Diff line change @@ -14,14 +14,15 @@ function M.get_all_sessions()
14
14
return {
15
15
workspace = session .metadata .working_dir ,
16
16
description = session .metadata .description ,
17
+ message_count = session .metadata .message_count ,
18
+ tokens = session .metadata .total_tokens ,
17
19
modified = session .modified ,
18
20
name = session .id ,
19
21
path = session .path
20
22
}
21
23
end , sessions )
22
24
end
23
25
24
- -- Helper function to get all sessions as JSON
25
26
function M .get_all_workspace_sessions ()
26
27
local sessions = M .get_all_sessions ()
27
28
if not sessions then return nil end
Original file line number Diff line number Diff line change 261
261
262
262
function M .render_session_bar ()
263
263
local function update_winbar (desc )
264
- -- content
264
+ --[[ ** TODO: use this right side win bar text with something useful
265
+ local winwidth = vim.api.nvim_win_get_width(state.windows.output_win)
266
+ local txt = "txt content here"
267
+ local padding = string.rep(" ", winwidth - #desc - #txt - 1)
268
+ local right_side_txt = padding .. txt
269
+ ]]
270
+
265
271
vim .wo [state .windows .output_win ].winbar = " " .. desc
266
272
267
273
-- Add our winbar highlights while preserving existing highlights
Original file line number Diff line number Diff line change @@ -62,12 +62,13 @@ function M._format_message(message)
62
62
63
63
for _ , part in ipairs (message .content ) do
64
64
if part .type == ' text' and part .text and part .text ~= " " then
65
+ local text = vim .trim (part .text )
65
66
has_content = true
66
67
67
68
if message .role == ' user' then
68
- M ._format_user_message (lines , part . text )
69
+ M ._format_user_message (lines , text )
69
70
elseif message .role == ' assistant' then
70
- for _ , line in ipairs (vim .split (part . text , " \n " )) do
71
+ for _ , line in ipairs (vim .split (text , " \n " )) do
71
72
table.insert (lines , line )
72
73
end
73
74
end
Original file line number Diff line number Diff line change @@ -170,12 +170,22 @@ function M.select_session(sessions, cb)
170
170
vim .ui .select (sessions , {
171
171
prompt = " " ,
172
172
format_item = function (session )
173
- if not session .modified then
174
- return session .description
173
+ local parts = {}
174
+
175
+ if session .description then
176
+ table.insert (parts , session .description )
177
+ end
178
+
179
+ if session .message_count then
180
+ table.insert (parts , session .message_count .. " messages" )
175
181
end
176
182
177
183
local modified = util .time_ago (session .modified )
178
- return session .description .. " ~ " .. modified
184
+ if modified then
185
+ table.insert (parts , modified )
186
+ end
187
+
188
+ return table.concat (parts , " ~ " )
179
189
end
180
190
}, function (session_choice )
181
191
cb (session_choice )
You can’t perform that action at this time.
0 commit comments