Skip to content

Commit

Permalink
update: fixed minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Feb 1, 2021
1 parent ee70577 commit c044e6d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions autoload/quickui/listbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ endfunc
" reposition text offset
"----------------------------------------------------------------------
function! quickui#listbox#reposition()
if mode() != 'i'
exec 'normal! zz'
endif
exec 'normal! zz'
let height = winheight(0)
let size = line('$')
let curline = line('.')
Expand Down Expand Up @@ -180,11 +178,9 @@ function! s:vim_create_listbox(textlist, opts)
if get(a:opts, 'index', 0) >= 0
let moveto = get(a:opts, 'index', 0) + 1
call popup_show(winid)
if mode() != 'i'
call win_execute(winid, 'normal! G')
call win_execute(winid, ':' . moveto)
call win_execute(winid, 'normal! G')
endif
call win_execute(winid, 'normal! G')
call win_execute(winid, ':' . moveto)
call win_execute(winid, 'normal! G')
call win_execute(winid, ':' . moveto)
call win_execute(winid, 'call quickui#listbox#reposition()')
endif
Expand Down Expand Up @@ -367,9 +363,7 @@ function! quickui#listbox#cursor_movement(where)
let curline = endline
endif
noautocmd exec ":" . curline
if mode() != 'i'
noautocmd exec "normal! 0"
endif
noautocmd exec "normal! 0"
endfunc


Expand Down

0 comments on commit c044e6d

Please sign in to comment.