@@ -89,9 +89,7 @@ local function build_toggle_open_context(restore_hidden)
8989 }
9090 end
9191
92- local focus = config .ui .input .auto_hide and ' input'
93- or state .last_focused_opencode_window
94- or ' input'
92+ local focus = config .ui .input .auto_hide and ' input' or state .last_focused_opencode_window or ' input'
9593
9694 return {
9795 focus = focus ,
@@ -100,21 +98,20 @@ local function build_toggle_open_context(restore_hidden)
10098end
10199
102100M .toggle = Promise .async (function (new_session )
103- local decision = state .resolve_toggle_decision (
104- config .ui .persist_state ,
105- state .display_route ~= nil
106- )
101+ local decision = state .resolve_toggle_decision (config .ui .persist_state , state .display_route ~= nil )
107102 local action = decision .action
108103 local is_new_session = new_session == true
109104
110105 local function open_windows (restore_hidden )
111106 local ctx = build_toggle_open_context (restore_hidden == true )
112- return core .open ({
113- new_session = is_new_session ,
114- focus = ctx .focus ,
115- start_insert = false ,
116- open_action = ctx .open_action ,
117- }):await ()
107+ return core
108+ .open ({
109+ new_session = is_new_session ,
110+ focus = ctx .focus ,
111+ start_insert = false ,
112+ open_action = ctx .open_action ,
113+ })
114+ :await ()
118115 end
119116
120117 local function open_fresh_windows ()
@@ -535,7 +532,7 @@ M.switch_mode = Promise.async(function()
535532end )
536533
537534function M .with_header (lines , show_welcome )
538- show_welcome = show_welcome or show_welcome
535+ show_welcome = show_welcome or false
539536 state .display_route = ' /header'
540537
541538 local msg = {
@@ -582,7 +579,7 @@ function M.help()
582579 return
583580 end
584581
585- local max_desc_length = math.min (90 , vim .api .nvim_win_get_width (state .windows .output_win ) - 30 )
582+ local max_desc_length = math.min (90 , vim .api .nvim_win_get_width (state .windows .output_win ) - 35 )
586583
587584 local sorted_commands = vim .tbl_keys (M .commands )
588585 table.sort (sorted_commands )
889886-- Returns the ID of the next user message after the current undo point
890887-- This is a port of the opencode tui logic
891888-- https://github.com/sst/opencode/blob/dev/packages/tui/internal/components/chat/messages.go#L1199
892- function find_next_message_for_redo ()
889+ local function find_next_message_for_redo ()
893890 if not state .active_session then
894891 return nil
895892 end
@@ -1163,7 +1160,7 @@ M.commands = {
11631160 },
11641161
11651162 review = {
1166- desc = ' Review changes [ commit| branch|pr] , defaults to uncommitted changes' ,
1163+ desc = ' Review changes ( commit/ branch/pr) , defaults to uncommitted changes' ,
11671164 fn = function (args )
11681165 M .review (args )
11691166 end ,
0 commit comments