Skip to content

Commit 48e37b3

Browse files
add contents(['line1', 'line2']) api
1 parent 34bf4e1 commit 48e37b3

File tree

1 file changed

+10
-0
lines changed
  • autoload/vital/__vital__/Experimental/UI

1 file changed

+10
-0
lines changed

autoload/vital/__vital__/Experimental/UI/Popup.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ function! s:show(id) abort
8181
call s:_notify(a:id, {}, 'show')
8282
endfunction
8383

84+
function! s:contents(id, contents) abort
85+
let data = s:_popups[a:id]
86+
let data['contents'] = a:contents
87+
if s:_has_nvim
88+
call nvim_buf_set_lines(data['bufnr'], 0, -1, 1, a:contents)
89+
else
90+
call popup_settext(data['winid'], a:contents)
91+
endif
92+
endfunction
93+
8494
function! s:_nvim_open_win(id, data) abort
8595
let opt = {
8696
\ 'relative': 'editor',

0 commit comments

Comments
 (0)