@@ -4,13 +4,11 @@ local M = {}
44
55M ._subscriptions = {}
66M ._part_cache = {}
7- M ._message_cache = {}
87M ._namespace = vim .api .nvim_create_namespace (' opencode_stream' )
98M ._prev_line_count = 0
109
1110function M .reset ()
1211 M ._part_cache = {}
13- M ._message_cache = {}
1412 M ._prev_line_count = 0
1513
1614 -- FIXME: this prolly isn't the right place for state.messages to be
@@ -87,15 +85,6 @@ function M._shift_lines(from_line, delta)
8785 end
8886 end
8987 end
90-
91- for msg_id , msg_data in pairs (M ._message_cache ) do
92- if msg_data .line_start and msg_data .line_start >= from_line then
93- msg_data .line_start = msg_data .line_start + delta
94- if msg_data .line_end then
95- msg_data .line_end = msg_data .line_end + delta
96- end
97- end
98- end
9988end
10089
10190function M ._apply_extmarks (buf , line_offset , extmarks )
@@ -304,14 +293,7 @@ function M.on_message_updated(event)
304293 table.insert (state .messages , { info = message , parts = {} })
305294 found_idx = # state .messages
306295
307- local header_range = M ._write_message_header (message , found_idx )
308- if header_range then
309- if not M ._message_cache [message .id ] then
310- M ._message_cache [message .id ] = {}
311- end
312- M ._message_cache [message .id ].line_start = header_range .line_start
313- M ._message_cache [message .id ].line_end = header_range .line_end
314- end
296+ M ._write_message_header (message , found_idx )
315297 end
316298
317299 M ._scroll_to_bottom ()
@@ -475,10 +457,6 @@ function M.on_message_removed(event)
475457 end
476458
477459 table.remove (state .messages , message_idx )
478-
479- if M ._message_cache [message_id ] then
480- M ._message_cache [message_id ] = nil
481- end
482460end
483461
484462function M .on_session_compacted ()
0 commit comments