1
0
Fork 0
mirror of synced 2024-12-25 08:13:20 -05:00

Update Coc.nvim

This commit is contained in:
Kurtis Moxley 2022-07-29 12:19:02 +08:00
parent 16d930cf30
commit 11e2e2c0c6
4 changed files with 148 additions and 121 deletions

View file

@ -292,8 +292,9 @@ function! coc#notify#close(winid) abort
endif endif
call coc#window#set_var(a:winid, 'closing', 1) call coc#window#set_var(a:winid, 'closing', 1)
call s:cancel(a:winid) call s:cancel(a:winid)
let curr = s:is_vim ? {'row': row} : {'winblend': coc#window#get_var(a:winid, 'winblend', 30)} let winblend = coc#window#get_var(a:winid, 'winblend', 0)
let dest = s:is_vim ? {'row': row + 1} : {'winblend': 60} let curr = s:is_vim ? {'row': row} : {'winblend': winblend}
let dest = s:is_vim ? {'row': row + 1} : {'winblend': winblend == 0 ? 0 : 60}
call s:animate(a:winid, curr, dest, 0, 1) call s:animate(a:winid, curr, dest, 0, 1)
endfunction endfunction

View file

@ -182,14 +182,10 @@ function! coc#util#jump(cmd, filepath, ...) abort
else else
exec 'drop '.fnameescape(file) exec 'drop '.fnameescape(file)
endif endif
elseif a:cmd == 'edit' elseif a:cmd == 'edit' && bufloaded(file)
if bufloaded(file)
exe 'b '.bufnr(file) exe 'b '.bufnr(file)
else else
exe a:cmd.' '.fnameescape(file) call s:safer_open(a:cmd, file)
endif
else
exe a:cmd.' '.fnameescape(file)
endif endif
if !empty(get(a:, 1, [])) if !empty(get(a:, 1, []))
let line = getline(a:1[0] + 1) let line = getline(a:1[0] + 1)
@ -208,6 +204,32 @@ function! coc#util#jump(cmd, filepath, ...) abort
endif endif
endfunction endfunction
function! s:safer_open(cmd, file) abort
" How to support :pedit and :drop?
let is_supported_cmd = index(["edit", "split", "vsplit", "tabe"], a:cmd) >= 0
" Use special handling only for URI.
let looks_like_uri = match(a:file, "^.*://") >= 0
if looks_like_uri && is_supported_cmd && has('win32') && exists('*bufadd')
" Workaround a bug for Win32 paths.
"
" reference:
" - https://github.com/vim/vim/issues/541
" - https://github.com/neoclide/coc-java/issues/82
" - https://github.com/vim-jp/issues/issues/6
let buf = bufadd(a:file)
if a:cmd != 'edit'
" Open split, tab, etc. by a:cmd.
exe a:cmd
endif
" Set current buffer to the file
exe 'keepjumps buffer ' . buf
else
exe a:cmd.' '.fnameescape(a:file)
endif
endfunction
function! coc#util#variables(bufnr) abort function! coc#util#variables(bufnr) abort
let info = getbufinfo(a:bufnr) let info = getbufinfo(a:bufnr)
let variables = empty(info) ? {} : copy(info[0]['variables']) let variables = empty(info) ? {} : copy(info[0]['variables'])

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,7 @@
# 2022-06-14
- Add highlight groups `CocListLine` and `CocListSearch`.
# 2022-06-11 # 2022-06-11
- Add configuration "notification.disabledProgressSources" - Add configuration "notification.disabledProgressSources"