3535local function build_right_segments ()
3636 local segments = {}
3737
38- if state .is_running () and not state .is_opening then
38+ if state .jobs . is_running () and not state .is_opening then
3939 local cancel_keymap = config .get_key_for_function (' input_window' , ' cancel' ) or ' <C-c>'
4040 table.insert (segments , { string.format (' %s ' , cancel_keymap ), ' OpencodeInputLegend' })
4141 table.insert (segments , { ' to cancel' , ' OpencodeHint' })
4242 table.insert (segments , { ' ' })
4343 end
4444
45- if not state .is_running () and state .current_model and config .ui .display_model then
45+ if not state .jobs . is_running () and state .current_model and config .ui .display_model then
4646 table.insert (segments , { state .current_model , ' OpencodeHint' })
4747 if state .current_variant then
4848 table.insert (segments , { ' ·' , ' OpencodeHint' })
@@ -151,13 +151,13 @@ function M.setup(windows)
151151 vim .api .nvim_set_option_value (' winhl' , ' Normal:OpencodeHint' , { win = windows .footer_win })
152152
153153 -- for model changes
154- state .subscribe (' current_model' , on_change )
155- state .subscribe (' current_mode' , on_change )
156- state .subscribe (' current_variant' , on_change )
157- state .subscribe (' active_session' , on_change )
154+ state .store . subscribe (' current_model' , on_change )
155+ state .store . subscribe (' current_mode' , on_change )
156+ state .store . subscribe (' current_variant' , on_change )
157+ state .store . subscribe (' active_session' , on_change )
158158 -- to show C-c message
159- state .subscribe (' job_count' , on_job_count_changed )
160- state .subscribe (' restore_points' , on_change )
159+ state .store . subscribe (' job_count' , on_job_count_changed )
160+ state .store . subscribe (' restore_points' , on_change )
161161
162162 vim .api .nvim_create_autocmd ({ ' VimResized' , ' WinResized' }, {
163163 group = vim .api .nvim_create_augroup (' OpencodeFooterResize' , { clear = true }),
@@ -180,12 +180,12 @@ function M.close(preserve_buffer)
180180 end
181181 end
182182
183- state .unsubscribe (' current_model' , on_change )
184- state .unsubscribe (' current_mode' , on_change )
185- state .unsubscribe (' current_variant' , on_change )
186- state .unsubscribe (' active_session' , on_change )
187- state .unsubscribe (' job_count' , on_job_count_changed )
188- state .unsubscribe (' restore_points' , on_change )
183+ state .store . unsubscribe (' current_model' , on_change )
184+ state .store . unsubscribe (' current_mode' , on_change )
185+ state .store . unsubscribe (' current_variant' , on_change )
186+ state .store . unsubscribe (' active_session' , on_change )
187+ state .store . unsubscribe (' job_count' , on_job_count_changed )
188+ state .store . unsubscribe (' restore_points' , on_change )
189189
190190 loading_animation .teardown ()
191191end
0 commit comments