@@ -88,6 +88,30 @@ M.markdown = function(root)
8888 virt_text = { virt_text },
8989 virt_text_pos = ' overlay' ,
9090 })
91+ elseif capture == ' table' then
92+ if state .config .fat_tables then
93+ local lines = vim .api .nvim_buf_get_lines (0 , start_row , end_row , false )
94+ local table_head = list .first (lines )
95+ local table_tail = list .last (lines )
96+ if # table_head == # table_tail then
97+ local headings = vim .split (table_head , ' |' , { plain = true , trimempty = true })
98+ local sections = vim .tbl_map (function (part )
99+ return string.rep (' ─' , # part )
100+ end , headings )
101+
102+ local line_above = { { ' ┌' .. table.concat (sections , ' ┬' ) .. ' ┐' , highlights .table .head } }
103+ vim .api .nvim_buf_set_extmark (0 , M .namespace , start_row , start_col , {
104+ virt_lines_above = true ,
105+ virt_lines = { line_above },
106+ })
107+
108+ local line_below = { { ' └' .. table.concat (sections , ' ┴' ) .. ' ┘' , highlights .table .row } }
109+ vim .api .nvim_buf_set_extmark (0 , M .namespace , end_row , start_col , {
110+ virt_lines_above = true ,
111+ virt_lines = { line_below },
112+ })
113+ end
114+ end
91115 elseif vim .tbl_contains ({ ' table_head' , ' table_delim' , ' table_row' }, capture ) then
92116 local row = value :gsub (' |' , ' │' )
93117 if capture == ' table_delim' then
0 commit comments