@@ -140,7 +140,7 @@ function M._format_revert_message(session_data, start_idx)
140140 local col = # (' ' .. file .. ' : ' )
141141 for _ , diff in ipairs (file_diff ) do
142142 local hl_group = diff :sub (1 , 1 ) == ' +' and ' OpencodeDiffAddText' or ' OpencodeDiffDeleteText'
143- output :add_extmark (line_idx , {
143+ output :add_extmark (line_idx - 1 , {
144144 virt_text = { { diff , hl_group } },
145145 virt_text_pos = ' inline' ,
146146 virt_text_win_col = col ,
@@ -259,7 +259,7 @@ function M.format_message_header(message)
259259 display_name = role :upper ()
260260 end
261261
262- output :add_extmark (output :get_line_count (), {
262+ output :add_extmark (output :get_line_count () - 1 , {
263263 virt_text = {
264264 { icon , role_hl },
265265 { ' ' },
@@ -636,7 +636,7 @@ function M._format_diff(output, code, file_type)
636636 local hl_group = first_char == ' +' and ' OpencodeDiffAdd' or ' OpencodeDiffDelete'
637637 output :add_line (' ' .. line :sub (2 ))
638638 local line_idx = output :get_line_count ()
639- output :add_extmark (line_idx , function ()
639+ output :add_extmark (line_idx - 1 , function ()
640640 return {
641641 end_col = 0 ,
642642 end_row = line_idx ,
665665--- @param win_col number
666666function M ._add_vertical_border (output , start_line , end_line , hl_group , win_col )
667667 for line = start_line , end_line do
668- output :add_extmark (line , {
668+ output :add_extmark (line - 1 , {
669669 virt_text = { { require (' opencode.ui.icons' ).get (' border' ), hl_group } },
670670 virt_text_pos = ' overlay' ,
671671 virt_text_win_col = win_col ,
0 commit comments