Skip to content

Commit e3e19c9

Browse files
authored
Merge pull request #67 from JimmyHuang454/master
add set_firstline()
2 parents 90ec2a2 + aaba2f3 commit e3e19c9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

autoload/quickui/utils.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,18 @@ function! quickui#utils#get_cursor(winid)
434434
endfunc
435435

436436

437+
"----------------------------------------------------------------------
438+
" first line to show in window.
439+
"----------------------------------------------------------------------
440+
function! quickui#utils#set_firstline(winid, line)
441+
if g:quickui#core#has_nvim == 0
442+
call popup_setoptions(a:winid, {'firstline': a:line})
443+
else
444+
call nvim_win_set_cursor(a:winid, [a:line, 0])
445+
endif
446+
endfunc
447+
448+
437449
"----------------------------------------------------------------------
438450
" get topline in current window
439451
"----------------------------------------------------------------------

0 commit comments

Comments
 (0)