Skip to content

Commit

Permalink
commit 1e177c4
Browse files Browse the repository at this point in the history
1e177c4 feat(format): support b:coc_disable_autoformat
e7abca2 fix(autocmds): use unique group for each autocmd
7f81235 feat(client): add coc#client#get_log
12d2587 fix(lua): refresh diagnostic for all loaded buffer (#5261)
59a853a fix(locations): consider unicode on jump
80c9c22 feat(extensions): use extensions section for configuration
d11a0ad feat(completion): use textEditText when default range exists
a7e1ceb chore(extension): fix typo
61e65da chore(doc): remove doc for vim & nvim which not supported
65574c5 fix(diagnostic): correct display configurations (#5262)
811f395 docs: use BufRead in b:coc_enabled example (#5259)
abf20cd chore(deps-dev): bump esbuild from 0.24.0 to 0.25.0 (#5256)
  • Loading branch information
chemzqm committed Feb 21, 2025
1 parent 408e250 commit 1d51cb3
Show file tree
Hide file tree
Showing 11 changed files with 1,285 additions and 1,141 deletions.
13 changes: 13 additions & 0 deletions autoload/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ function! coc#expandableOrJumpable() abort
return coc#rpc#request('snippetCheck', [1, 1])
endfunction

function! coc#clearGroups(prefix) abort
" 遍历所有 augroup 名称
for group in getcompletion('', 'augroup')
" 检查是否以指定前缀开头
if group =~# '^' . a:prefix
" 进入该 augroup,执行清空操作
execute 'augroup ' . group
autocmd!
augroup END
endif
endfor
endfunction

" add vim command to CocCommand list
function! coc#add_command(id, cmd, ...)
let config = {'id':a:id, 'cmd':a:cmd, 'title': get(a:,1,'')}
Expand Down
10 changes: 9 additions & 1 deletion autoload/coc/client.vim
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,20 @@ endfunction

function! coc#client#open_log()
if !get(g:, 'node_client_debug', 0)
echohl Error | echon '[coc.nvim] use let g:node_client_debug = 1 in your vimrc to enable debug mode.' | echohl None
throw '[coc.nvim] use let g:node_client_debug = 1 in your vimrc to enable debug mode.'
return
endif
execute 'vs '.s:logfile
endfunction

function! coc#client#get_log()
if !get(g:, 'node_client_debug', 0)
throw '[coc.nvim] use let g:node_client_debug = 1 in your vimrc to enable debug mode.'
return ''
endif
return s:logfile
endfunction

function! s:on_error(name, msgs) abort
echohl ErrorMsg
echo join(a:msgs, "\n")
Expand Down
3 changes: 0 additions & 3 deletions autoload/coc/float.vim
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,6 @@ function! coc#float#has_scroll() abort
endfunction

function! coc#float#scroll(forward, ...)
if !has('nvim-0.4.0') && !has('patch-8.2.0750')
throw 'coc#float#scroll() requires nvim >= 0.4.0 or vim >= 8.2.0750'
endif
let amount = get(a:, 1, 0)
let winids = filter(coc#float#get_float_win_list(), 'coc#float#scrollable(v:val) && getwinvar(v:val,"kind","") !=# "pum"')
if empty(winids)
Expand Down
4 changes: 1 addition & 3 deletions autoload/coc/rpc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ function! coc#rpc#restart()
call coc#highlight#clear_all()
call coc#ui#sign_unplace()
call coc#float#close_all()
autocmd! coc_dynamic_autocmd
autocmd! coc_dynamic_content
autocmd! coc_dynamic_option
call coc#clearGroups('coc_dynamic_')
call coc#rpc#request('detach', [])
if !empty(get(g:, 'coc_status', ''))
unlet g:coc_status
Expand Down
Loading

0 comments on commit 1d51cb3

Please sign in to comment.