Skip to content

Commit

Permalink
Fix undefined variable: size error of coc#pum#scroll() & coc#pum#in…
Browse files Browse the repository at this point in the history
…fo() support `reversed`
  • Loading branch information
qiqiboy committed Sep 1, 2022
1 parent 8a6a8e1 commit 50a3a96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoload/coc/pum.vim
Expand Up @@ -174,6 +174,7 @@ function! coc#pum#info() abort
\ 'size': s:pum_size,
\ 'border': border,
\ 'inserted': s:inserted ? v:true : v:false,
\ 'reversed': s:reversed ? v:true : v:false,
\ }
else
let scrollbar = coc#float#get_related(s:pum_winid, 'scrollbar')
Expand All @@ -190,14 +191,15 @@ function! coc#pum#info() abort
\ 'size': s:pum_size,
\ 'border': winid != s:pum_winid,
\ 'inserted': s:inserted ? v:true : v:false,
\ 'reversed': s:reversed ? v:true : v:false,
\ }
endif
endfunction

function! coc#pum#scroll(forward) abort
if coc#pum#visible()
let height = s:get_height(s:pum_winid)
if size > height
if s:pum_size > height
call timer_start(10, { -> s:scroll_pum(a:forward, height, s:pum_size)})
endif
endif
Expand Down
2 changes: 2 additions & 0 deletions doc/coc.txt
Expand Up @@ -1886,6 +1886,8 @@ coc#pum#info() *coc#pum#info()*
height Height of pum, including padding and border.
size Count of displayed complete items.
inserted Is |v:true| when there is item inserted.
reversed Is |v:true| when pum shown above cursor and
enable |suggest.reversePumAboveCursor|

coc#pum#select({index}, {insert}, {confirm}) *coc#pum#select()*

Expand Down

0 comments on commit 50a3a96

Please sign in to comment.