diff --git a/autoload/quickui/utils.vim b/autoload/quickui/utils.vim index 7486583..b63ad98 100644 --- a/autoload/quickui/utils.vim +++ b/autoload/quickui/utils.vim @@ -434,6 +434,18 @@ function! quickui#utils#get_cursor(winid) endfunc +"---------------------------------------------------------------------- +" first line to show in window. +"---------------------------------------------------------------------- +function! quickui#utils#set_firstline(winid, line) + if g:quickui#core#has_nvim == 0 + call popup_setoptions(a:winid, {'firstline': a:line}) + else + call nvim_win_set_cursor(a:winid, [a:line, 0]) + endif +endfunc + + "---------------------------------------------------------------------- " get topline in current window "----------------------------------------------------------------------