File tree Expand file tree Collapse file tree
lua/render-markdown/render/markdown Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,14 +254,10 @@ function Render:compute_layout()
254254 end
255255 end
256256 -- Raw buffer line screen-wrap: ceil(display_width_of_source / win_width)
257- local buf_line = vim .api .nvim_buf_get_lines (
258- self .context .buf ,
259- row .node .start_row ,
260- row .node .start_row + 1 ,
261- false
262- )[1 ] or ' '
257+ local _ , line = row .node :line (' first' , 0 )
258+ line = line or ' '
263259 local raw_screen_lines =
264- math.max (1 , math.ceil (str .width (buf_line ) / win_width ))
260+ math.max (1 , math.ceil (str .width (line ) / win_width ))
265261 if raw_screen_lines > max_lines then
266262 max_lines = raw_screen_lines
267263 needs_wrap = true
@@ -619,12 +615,8 @@ function Render:row_wrapped(row, row_index)
619615 return line
620616 end
621617
622- local buf_line = vim .api .nvim_buf_get_lines (
623- self .context .buf ,
624- row .node .start_row ,
625- row .node .start_row + 1 ,
626- false
627- )[1 ] or ' '
618+ local _ , buf_line = row .node :line (' first' , 0 )
619+ buf_line = buf_line or ' '
628620 local win_width = env .win .width (self .context .win )
629621 local buf_screen_lines =
630622 math.max (1 , math.ceil (str .width (buf_line ) / win_width ))
You can’t perform that action at this time.
0 commit comments