Skip to content

Commit

Permalink
fix(highlight): check hlexists for vim
Browse files Browse the repository at this point in the history
  • Loading branch information
fannheyward committed Feb 22, 2024
1 parent 07e0afa commit 113f59e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoload/coc/highlight.vim
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ function! coc#highlight#add_highlight(bufnr, src_id, hl_group, line, col_start,
call nvim_buf_add_highlight(a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end)
endif
else
call coc#api#exec('buf_add_highlight', [a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end, opts])
if hlexists(a:hl_group)
call coc#api#exec('buf_add_highlight', [a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end, opts])
endif
endif
endfunction

Expand Down

0 comments on commit 113f59e

Please sign in to comment.