@@ -199,14 +199,14 @@ local function render_symbols(panel)
199199 table.insert (lines , text )
200200 local text_cols = vim .api .nvim_strwidth (text )
201201 table.insert (highlights , { " Aerial" .. item .kind .. " Icon" , i - 1 , 0 , kind :len () })
202- table.insert (highlights , { " Aerial" .. item .kind , i - 1 , kind :len (), - 1 })
202+ table.insert (highlights , { " Aerial" .. item .kind , i - 1 , kind :len (), text : len () })
203203 max_len = math.max (max_len , text_cols )
204204 end
205205
206206 -- If there are no symbols in this section, add some indicator of that
207207 if # lines == 0 then
208208 table.insert (lines , " <none>" )
209- table.insert (highlights , { " Comment" , 0 , 0 , - 1 })
209+ table.insert (highlights , { " Comment" , 0 , 0 , 6 })
210210 end
211211
212212 vim .bo [bufnr ].modifiable = true
@@ -217,7 +217,11 @@ local function render_symbols(panel)
217217 local ns = vim .api .nvim_create_namespace (" aerial" )
218218 vim .api .nvim_buf_clear_namespace (bufnr , ns , 0 , - 1 )
219219 for _ , hl in ipairs (highlights ) do
220- vim .api .nvim_buf_add_highlight (bufnr , ns , unpack (hl ))
220+ local hl_group , line , col , end_col = unpack (hl )
221+ vim .api .nvim_buf_set_extmark (bufnr , ns , line , col , {
222+ end_col = end_col ,
223+ hl_group = hl_group ,
224+ })
221225 end
222226 panel .width = max_len
223227 panel .height = # lines
0 commit comments