From 5e2f575be37de77284ed89204c280e325e3f97f9 Mon Sep 17 00:00:00 2001 From: zoumi Date: Wed, 13 Nov 2024 20:24:27 +0800 Subject: [PATCH] improve performance for large file improve performance for large file (still don't know why this func is called for a buf with b:coc_enabled = 0) --- autoload/coc/api.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/coc/api.vim b/autoload/coc/api.vim index 5aa9cd99928..74583dda76d 100644 --- a/autoload/coc/api.vim +++ b/autoload/coc/api.vim @@ -508,7 +508,7 @@ endfunction function! s:funcs.buf_clear_namespace(bufnr, srcId, startLine, endLine) abort let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr let start = a:startLine + 1 - let end = a:endLine == -1 ? len(getbufline(bufnr, 1, '$')) : a:endLine + let end = a:endLine == -1 ? s:buf_line_count(bufnr) : a:endLine if a:srcId == -1 if has_key(s:buffer_id, a:bufnr) unlet s:buffer_id[a:bufnr]