@@ -87,9 +87,7 @@ endfunc
8787" reposition text offset
8888" ----------------------------------------------------------------------
8989function ! quickui#listbox#reposition ()
90- if mode () != ' i'
91- exec ' normal! zz'
92- endif
90+ exec ' normal! zz'
9391 let height = winheight (0 )
9492 let size = line (' $' )
9593 let curline = line (' .' )
@@ -180,11 +178,9 @@ function! s:vim_create_listbox(textlist, opts)
180178 if get (a: opts , ' index' , 0 ) >= 0
181179 let moveto = get (a: opts , ' index' , 0 ) + 1
182180 call popup_show (winid)
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
181+ call win_execute (winid, ' normal! G' )
182+ call win_execute (winid, ' :' . moveto)
183+ call win_execute (winid, ' normal! G' )
188184 call win_execute (winid, ' :' . moveto)
189185 call win_execute (winid, ' call quickui#listbox#reposition()' )
190186 endif
@@ -367,9 +363,7 @@ function! quickui#listbox#cursor_movement(where)
367363 let curline = endline
368364 endif
369365 noautocmd exec " :" . curline
370- if mode () != ' i'
371- noautocmd exec " normal! 0"
372- endif
366+ noautocmd exec " normal! 0"
373367endfunc
374368
375369
0 commit comments