@@ -87,7 +87,9 @@ endfunc
8787" reposition text offset
8888" ----------------------------------------------------------------------
8989function ! quickui#listbox#reposition ()
90- exec ' normal! zz'
90+ if mode () != ' i'
91+ exec ' normal! zz'
92+ endif
9193let height = winheight (0 )
9294let size = line (' $' )
9395let curline = line (' .' )
@@ -178,9 +180,11 @@ function! s:vim_create_listbox(textlist, opts)
178180if get (a: opts , ' index' , 0 ) >= 0
179181let moveto = get (a: opts , ' index' , 0 ) + 1
180182call popup_show (winid)
181- call win_execute (winid, ' normal! G' )
182- call win_execute (winid, ' :' . moveto)
183- call win_execute (winid, ' normal! G' )
183+ if mode () != ' i'
184+ call win_execute (winid, ' normal! G' )
185+ call win_execute (winid, ' :' . moveto)
186+ call win_execute (winid, ' normal! G' )
187+ endif
184188call win_execute (winid, ' :' . moveto)
185189call win_execute (winid, ' call quickui#listbox#reposition()' )
186190endif
@@ -363,7 +367,9 @@ function! quickui#listbox#cursor_movement(where)
363367let curline = endline
364368endif
365369noautocmd exec " :" . curline
366- noautocmd exec " normal! 0"
370+ if mode () != ' i'
371+ noautocmd exec " normal! 0"
372+ endif
367373endfunc
368374
369375
0 commit comments