Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issues #4879 and #4872 #4885

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoload/coc/api.vim
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ function! s:funcs.buf_add_highlight(bufnr, srcId, hlGroup, line, colStart, colEn
let id = s:generate_id(a:bufnr)
try
call prop_add(a:line + 1, a:colStart + 1, {'bufnr': bufnr, 'type': type, 'id': id, 'end_col': end})
catch /^Vim\%((\a\+)\)\=:E967/
catch /^Vim\%((\a\+)\)\=:\(E967\|E964\)/
" ignore 967
endtry
if a:srcId == 0
Expand Down
18 changes: 9 additions & 9 deletions autoload/coc/highlight.vim
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,15 @@ function! s:update_highlights_timer(bufnr, changedtick, key, priority, groups, i
endfunction

function! s:add_highlights_timer(bufnr, ns, highlights, priority) abort
let hls = []
let next = []
for i in range(0, len(a:highlights) - 1)
if i < g:coc_highlight_maximum_count
call add(hls, a:highlights[i])
else
call add(next, a:highlights[i])
endif
endfor
let lhl = len(a:highlights)
let maxc = g:coc_highlight_maximum_count
if maxc < lhl
let hls = a:highlights[:maxc-1]
let next = a:highlights[maxc:]
else
let hls = a:highlights[:]
let next = []
endif
call s:add_highlights(a:bufnr, a:ns, hls, a:priority)
if len(next)
call timer_start(30, {->s:add_highlights_timer(a:bufnr, a:ns, next, a:priority)})
Expand Down
Loading