Skip to content

Commit

Permalink
fix(notify): use nvim_buf_set_lines for nvim (#4542)
Browse files Browse the repository at this point in the history
close #4511
  • Loading branch information
fannheyward committed May 29, 2023
1 parent 5704b37 commit 0df7380
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions autoload/coc/notify.vim
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,12 @@ function! s:progress(winid, total, curr, index) abort
if !empty(message)
let lines = lines + coc#string#reflow(split(message, '\v\r?\n'), width)
endif
noa call setbufline(bufnr, 1, lines)
noa call deletebufline(bufnr, len(lines) + 1, '$')
if has('nvim')
call nvim_buf_set_lines(bufnr, 0, -1, v:false, lines)
else
noa call setbufline(bufnr, 1, lines)
noa call deletebufline(bufnr, len(lines) + 1, '$')
endif
let height = option['height']
let delta = len(lines) - height
if delta > 0 && height < 3
Expand Down

0 comments on commit 0df7380

Please sign in to comment.