@@ -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
9193 let height = winheight (0 )
9294 let size = line (' $' )
9395 let curline = line (' .' )
@@ -178,9 +180,11 @@ function! s:vim_create_listbox(textlist, opts)
178180 if get (a: opts , ' index' , 0 ) >= 0
179181 let moveto = get (a: opts , ' index' , 0 ) + 1
180182 call 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
184188 call win_execute (winid, ' :' . moveto)
185189 call win_execute (winid, ' call quickui#listbox#reposition()' )
186190 endif
@@ -363,7 +367,9 @@ function! quickui#listbox#cursor_movement(where)
363367 let curline = endline
364368 endif
365369 noautocmd exec " :" . curline
366- noautocmd exec " normal! 0"
370+ if mode () != ' i'
371+ noautocmd exec " normal! 0"
372+ endif
367373endfunc
368374
369375
0 commit comments