File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,9 @@ function M.set_review_breakpoint()
210210end
211211
212212function M .prev_history ()
213+ if not state .windows then
214+ return
215+ end
213216 local prev_prompt = history .prev ()
214217 if prev_prompt then
215218 input_window .set_content (prev_prompt )
@@ -218,6 +221,9 @@ function M.prev_history()
218221end
219222
220223function M .next_history ()
224+ if not state .windows then
225+ return
226+ end
221227 local next_prompt = history .next ()
222228 if next_prompt then
223229 input_window .set_content (next_prompt )
@@ -428,7 +434,11 @@ function M.help()
428434 ' |-----------|---------------------|' ,
429435 }, false )
430436
431- local max_desc_length = (vim .api .nvim_win_get_width (state .windows .output_win ) / 2 ) - 5
437+ if not state .windows or not state .windows .output_win then
438+ return
439+ end
440+
441+ local max_desc_length = math.floor ((vim .api .nvim_win_get_width (state .windows .output_win ) / 2 ) - 5 )
432442
433443 for _ , def in pairs (M .commands ) do
434444 local desc = def .desc or ' '
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ function M.get_messages(session)
168168end
169169
170170--- Get snapshot IDs from a message's parts
171- --- @param message OpencodeMessage
171+ --- @param message OpencodeMessage ?
172172--- @return string[] | nil
173173function M .get_message_snapshot_ids (message )
174174 if not message then
Original file line number Diff line number Diff line change 3535--- @field snapshot string
3636--- @field diff string
3737
38+ --- @class SessionShareInfo
39+ --- @field url string
40+
3841--- @class Session
3942--- @field workspace string
4043--- @field description string
4750--- @field snapshot_path string
4851--- @field cache_path string
4952--- @field revert ? SessionRevertInfo
53+ --- @field share ? SessionShareInfo
5054
5155--- @class OpencodeKeymapEntry
5256--- @field [ 1] string # Function name
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ local input_window = require('opencode.ui.input_window')
77local footer = require (' opencode.ui.footer' )
88local topbar = require (' opencode.ui.topbar' )
99
10- --- @param windows OpencodeWindowState
10+ --- @param windows OpencodeWindowState ?
1111function M .close_windows (windows )
1212 if not windows then
1313 return
You can’t perform that action at this time.
0 commit comments