Update Coc.nvim
This commit is contained in:
parent
16d930cf30
commit
11e2e2c0c6
4 changed files with 148 additions and 121 deletions
|
@ -292,8 +292,9 @@ function! coc#notify#close(winid) abort
|
|||
endif
|
||||
call coc#window#set_var(a:winid, 'closing', 1)
|
||||
call s:cancel(a:winid)
|
||||
let curr = s:is_vim ? {'row': row} : {'winblend': coc#window#get_var(a:winid, 'winblend', 30)}
|
||||
let dest = s:is_vim ? {'row': row + 1} : {'winblend': 60}
|
||||
let winblend = coc#window#get_var(a:winid, 'winblend', 0)
|
||||
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)
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -182,14 +182,10 @@ function! coc#util#jump(cmd, filepath, ...) abort
|
|||
else
|
||||
exec 'drop '.fnameescape(file)
|
||||
endif
|
||||
elseif a:cmd == 'edit'
|
||||
if bufloaded(file)
|
||||
elseif a:cmd == 'edit' && bufloaded(file)
|
||||
exe 'b '.bufnr(file)
|
||||
else
|
||||
exe a:cmd.' '.fnameescape(file)
|
||||
endif
|
||||
else
|
||||
exe a:cmd.' '.fnameescape(file)
|
||||
call s:safer_open(a:cmd, file)
|
||||
endif
|
||||
if !empty(get(a:, 1, []))
|
||||
let line = getline(a:1[0] + 1)
|
||||
|
@ -208,6 +204,32 @@ function! coc#util#jump(cmd, filepath, ...) abort
|
|||
endif
|
||||
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
|
||||
let info = getbufinfo(a:bufnr)
|
||||
let variables = empty(info) ? {} : copy(info[0]['variables'])
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,7 @@
|
|||
# 2022-06-14
|
||||
|
||||
- Add highlight groups `CocListLine` and `CocListSearch`.
|
||||
|
||||
# 2022-06-11
|
||||
|
||||
- Add configuration "notification.disabledProgressSources"
|
||||
|
|
Loading…
Reference in a new issue