Closed TaylorTrz closed 2 months ago
any global argument can be added to disable this auto command
No such configuration and there's no plan to add this. coc.nvim needs CursorMoved
to refresh diagnostic/highlight/codeLens etc.
I'm using coc.nvim with lualine, didn't find any noticeable slowdown, what's your nvim version?
any global argument can be added to disable this auto command
No such configuration and there's no plan to add this. coc.nvim needs
CursorMoved
to refresh diagnostic/highlight/codeLens etc.I'm using coc.nvim with lualine, didn't find any noticeable slowdown, what's your nvim version?
Version info:
$ nvim --version
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/share/nvim"
Run :checkhealth for more info
Can you show me your test result to execute this vim script?
function! s:localtime_milli()
let s:lt = reltime()
return s:lt[0] * 1000 + s:lt[1] / 1000
endfunction
function! s:Autocmd(...) abort
if !get(g:, 'coc_workspace_initialized', 0)
return
endif
call coc#rpc#notify('CocAutocmd', a:000)
endfunction
" -------------------------------------------------------------------------------------------------
for x in range(1000)
let s:start = s:localtime_milli()
call s:Autocmd('CursorMoved', +expand('<abuf>'), [line('.'), col('.')])
let s:elapsed = s:localtime_milli() - s:start
echomsg s:elapsed
endfor
" -------------------------------------------------------------------------------------------------
Similar with your result:
Similar with your result:
![]()
Thanks for you reply.
Do you use nvim-treesitter with ibl? I don't use ibl and treesitter but I knew ibl + nvim-treesitter may cause some slowness, disable treesitter and try again.
Do you use nvim-treesitter with ibl? I don't use ibl and treesitter but I knew ibl + nvim-treesitter may cause some slowness, disable treesitter and try again.
Yes, after disable treesitter, I noticed an improvement in test results. About 20% time was reduced.
Is your feature request related to a problem? Please describe. I was happy with coc.nvim until recently. After a few plugins installed, the cursor movement action (Enter
j
ork
) sometimes seems slow. So I tried to find all autocmd, it seems CursorMove autocmd in coc.nvim quite slow.Test result was given below, in milliseconds:
CursorMove can be a significant element to neovim plugin, Can it been disabled or imporved?
Describe the solution you'd like Disable the "CursorMove" in
plugin/coc.nvim
can fasten all cursor movement:Describe alternatives you've considered After I tried to search "CursorMove" in source code, it seems all the important object (treeview, ui, ...) related to this. I wonder if any global argument can be added to disable this auto command.
Additional context My coc.nvim configuration:
And the test vim script: