scalameta / coc-metals

Deprecated in favor of scalameta/nvim-metals
http://scalameta.org/metals/
Apache License 2.0
167 stars 24 forks source link

Fix has_preview exeption #423

Closed ajkaanbal closed 3 years ago

ajkaanbal commented 3 years ago

I checked the signature of the removed function and I think coc#list#has_preview does the same.

https://github.com/neoclide/coc.nvim/commit/00ed6677383e56d79cb2812bfe954f424bb15ded#diff-600a800688b494cf9156b1d447016c253461ad3e3553ae6b9e52b31453e792deL22

function! coc#util#has_preview()
  for i in range(1, winnr('$'))
    if getwinvar(i, '&previewwindow')
      return i
    endif
  endfor
  return 0
endfunction

https://github.com/neoclide/coc.nvim/blob/e231666bcb532fac61ba50dd69e3b31477f43982/autoload/coc/list.vim#L102

" Check if previewwindow exists on current tab.
function! coc#list#has_preview()
  for i in range(1, winnr('$'))
    let preview = getwinvar(i, 'previewwindow', getwinvar(i, '&previewwindow', 0))
    if preview
      return i
    endif
  endfor
  return 0
endfunction

Solves #421